diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2578662..4708b95 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,3 +52,26 @@ jobs: - uses: actions/checkout@v7 - name: "Run resolver tests" run: python3 -m unittest discover -s test -p 'test_resolve_monorepo_tagbot.py' -v + + workflow-group-tests: + name: "Test group (${{ matrix.os }}, ${{ matrix.group-env-name }})" + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + group-env-name: GROUP + - os: windows-latest + group-env-name: GROUP + - os: windows-latest + group-env-name: SCIML_WORKFLOW_TEST_GROUP + uses: ./.github/workflows/tests.yml + with: + julia-version: "1" + os: ${{ matrix.os }} + group: Core + group-env-name: ${{ matrix.group-env-name }} + project: test/fixtures/WorkflowGroupProbe + num-threads: "1" + buildpkg: false + coverage: false diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 6520e3d..399e845 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -98,6 +98,7 @@ jobs: run: julia --color=yes --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - name: "Build and Deploy Documentation" + shell: bash env: # Documenter decides it can deploy when GITHUB_TOKEN or DOCUMENTER_KEY is merely # non-empty (`auth_ok` in Documenter's `deploy_folder`). A read-only token still diff --git a/.github/workflows/downgrade.yml b/.github/workflows/downgrade.yml index 7339b5a..80afe24 100644 --- a/.github/workflows/downgrade.yml +++ b/.github/workflows/downgrade.yml @@ -76,6 +76,7 @@ jobs: version: "${{ inputs.julia-version }}" - name: "Compute effective downgrade skip list" + shell: bash run: | # Effective skip = Julia stdlibs ∪ the caller's `skip` input (extra # skips). Standard libraries are always in-tree at their pinned diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 229279e..5d15446 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -239,6 +239,7 @@ jobs: # name must be dynamic, which the env: map can't express, so write it to # $GITHUB_ENV here. if: "${{ steps.prerelease-gate.outputs.run != 'false' }}" + shell: bash run: echo "${{ inputs.group-env-name }}=${{ inputs.group }}" >> "$GITHUB_ENV" - name: "Run tests ${{ inputs.self-hosted && '' || format('on {0}', inputs.os) }} with Julia v${{ inputs.julia-version }}" diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..c7db6bd --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,4 @@ +# Reusable workflow validation + +- Declare `shell: bash` on Bash `run:` steps in workflows that accept Windows runners, including writes to GitHub environment/output/path files and inline environment assignments. +- Validate workflows with `actionlint`, helper scripts with `julia --project=. test/runtests.jl` and `python3 -m unittest discover -s test -p 'test_*.py' -v`, and group propagation with the `workflow-group-tests` CI matrix. diff --git a/test/fixtures/WorkflowGroupProbe/Project.toml b/test/fixtures/WorkflowGroupProbe/Project.toml new file mode 100644 index 0000000..3c722cf --- /dev/null +++ b/test/fixtures/WorkflowGroupProbe/Project.toml @@ -0,0 +1,9 @@ +name = "WorkflowGroupProbe" +uuid = "673c1741-4a25-48f2-9848-e60578bc4957" +version = "0.1.0" + +[extras] +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[targets] +test = ["Test"] diff --git a/test/fixtures/WorkflowGroupProbe/src/WorkflowGroupProbe.jl b/test/fixtures/WorkflowGroupProbe/src/WorkflowGroupProbe.jl new file mode 100644 index 0000000..c801643 --- /dev/null +++ b/test/fixtures/WorkflowGroupProbe/src/WorkflowGroupProbe.jl @@ -0,0 +1,2 @@ +module WorkflowGroupProbe +end diff --git a/test/fixtures/WorkflowGroupProbe/test/runtests.jl b/test/fixtures/WorkflowGroupProbe/test/runtests.jl new file mode 100644 index 0000000..6f91d2d --- /dev/null +++ b/test/fixtures/WorkflowGroupProbe/test/runtests.jl @@ -0,0 +1,11 @@ +using Test + +@testset "Workflow test group" begin + group = get(ENV, "GROUP", "") + custom_group = get(ENV, "SCIML_WORKFLOW_TEST_GROUP", "") + selected_group = isempty(custom_group) ? group : custom_group + println("GROUP=", repr(group)) + println("SCIML_WORKFLOW_TEST_GROUP=", repr(custom_group)) + println("Selected test group=", repr(isempty(selected_group) ? "All" : selected_group)) + @test selected_group == "Core" +end