diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 2bcf0daa6..9681309db 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,10 +14,11 @@ on: - main jobs: - + build_clis_linux: name: "Build CLIs (linux)" runs-on: ubuntu-latest + permissions: pull-requests: write checks: write @@ -50,7 +51,7 @@ jobs: if: ${{ github.event_name != 'push' }} with: pr_number: ${{ github.event.client_payload.pull_request.number }} - job: Build CLIs (<<- target >>) + job: Build CLIs (linux) workflow: "Build and store docs artifacts" run_id: ${{ github.run_id }} github_token: ${{ secrets.GITHUB_TOKEN }} @@ -76,15 +77,16 @@ jobs: if: ${{ always() && github.event_name != 'push' }} with: pr_number: ${{ github.event.client_payload.pull_request.number }} - job: Build CLIs (<<- target >>) + job: Build CLIs (linux) conclusion: ${{ job.status }} github_token: ${{ secrets.GITHUB_TOKEN }} - + tests_linux: name: "Run tests (linux)" runs-on: ubuntu-latest needs: - build_clis_linux + permissions: pull-requests: write checks: write @@ -117,7 +119,7 @@ jobs: if: ${{ github.event_name != 'push' }} with: pr_number: ${{ github.event.client_payload.pull_request.number }} - job: Run tests (<< target >>) + job: Run tests (linux) workflow: "Build and store docs artifacts" run_id: ${{ github.run_id }} github_token: ${{ secrets.GITHUB_TOKEN }} @@ -166,13 +168,14 @@ jobs: if: ${{ always() && github.event_name != 'push' }} with: pr_number: ${{ github.event.client_payload.pull_request.number }} - job: Run tests (<< target >>) + job: Run tests (linux) conclusion: ${{ job.status }} github_token: ${{ secrets.GITHUB_TOKEN }} - + build_clis_macos: name: "Build CLIs (macos)" runs-on: macos-14 + permissions: pull-requests: write checks: write @@ -205,7 +208,7 @@ jobs: if: ${{ github.event_name != 'push' }} with: pr_number: ${{ github.event.client_payload.pull_request.number }} - job: Build CLIs (<<- target >>) + job: Build CLIs (macos) workflow: "Build and store docs artifacts" run_id: ${{ github.run_id }} github_token: ${{ secrets.GITHUB_TOKEN }} @@ -231,15 +234,16 @@ jobs: if: ${{ always() && github.event_name != 'push' }} with: pr_number: ${{ github.event.client_payload.pull_request.number }} - job: Build CLIs (<<- target >>) + job: Build CLIs (macos) conclusion: ${{ job.status }} github_token: ${{ secrets.GITHUB_TOKEN }} - + tests_macos: name: "Run tests (macos)" runs-on: macos-14 needs: - build_clis_macos + permissions: pull-requests: write checks: write @@ -272,7 +276,7 @@ jobs: if: ${{ github.event_name != 'push' }} with: pr_number: ${{ github.event.client_payload.pull_request.number }} - job: Run tests (<< target >>) + job: Run tests (macos) workflow: "Build and store docs artifacts" run_id: ${{ github.run_id }} github_token: ${{ secrets.GITHUB_TOKEN }} @@ -321,13 +325,14 @@ jobs: if: ${{ always() && github.event_name != 'push' }} with: pr_number: ${{ github.event.client_payload.pull_request.number }} - job: Run tests (<< target >>) + job: Run tests (macos) conclusion: ${{ job.status }} github_token: ${{ secrets.GITHUB_TOKEN }} - + build_clis_windows: name: "Build CLIs (windows)" runs-on: windows-2022 + permissions: pull-requests: write checks: write @@ -360,7 +365,7 @@ jobs: if: ${{ github.event_name != 'push' }} with: pr_number: ${{ github.event.client_payload.pull_request.number }} - job: Build CLIs (<<- target >>) + job: Build CLIs (windows) workflow: "Build and store docs artifacts" run_id: ${{ github.run_id }} github_token: ${{ secrets.GITHUB_TOKEN }} @@ -386,15 +391,16 @@ jobs: if: ${{ always() && github.event_name != 'push' }} with: pr_number: ${{ github.event.client_payload.pull_request.number }} - job: Build CLIs (<<- target >>) + job: Build CLIs (windows) conclusion: ${{ job.status }} github_token: ${{ secrets.GITHUB_TOKEN }} - + tests_windows: name: "Run tests (windows)" runs-on: windows-2022 needs: - build_clis_windows + permissions: pull-requests: write checks: write @@ -427,7 +433,7 @@ jobs: if: ${{ github.event_name != 'push' }} with: pr_number: ${{ github.event.client_payload.pull_request.number }} - job: Run tests (<< target >>) + job: Run tests (windows) workflow: "Build and store docs artifacts" run_id: ${{ github.run_id }} github_token: ${{ secrets.GITHUB_TOKEN }} @@ -470,7 +476,7 @@ jobs: if: ${{ always() && github.event_name != 'push' }} with: pr_number: ${{ github.event.client_payload.pull_request.number }} - job: Run tests (<< target >>) + job: Run tests (windows) conclusion: ${{ job.status }} github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/ci_utils/templates/ci.jinja b/ci_utils/templates/ci.jinja index 3e523d74e..ffe4450e4 100644 --- a/ci_utils/templates/ci.jinja +++ b/ci_utils/templates/ci.jinja @@ -15,34 +15,32 @@ on: jobs: <%- for (os, target, binary_extension) in [ - ('ubuntu-latest', 'linux', ''), - ('macos-14', 'macos', ''), + ('ubuntu-latest', 'linux', ''), + ('macos-14', 'macos', ''), ('windows-2022', 'windows', '.exe') ] %> - + build_clis_<<- target >>: name: "Build CLIs (<<- target >>)" runs-on: << os >> - <%- with job_name = "Build CLIs (<<- target >>)" -%> - <%- from 'build_clis_steps' import output -%> + <% set job_name %>Build CLIs (<<- target >>)<% endset %> + <%- from 'build_clis_steps' import output -%> <<- output | indent(4) >> - <%- endwith %> - + tests_<<- target >>: name: "Run tests (<<- target >>)" runs-on: << os >> needs: - build_clis_<<- target >> - <%- with job_name = 'Run tests (<< target >>)' -%> - <%- from 'tests_steps' import output -%> + <% set job_name %>Run tests (<<- target >>)<% endset %> + <%- from 'tests_steps' import output -%> <<- output | indent(4) >> - <%- endwith %> <%- endfor %> build_tutorial_generator: runs-on: ubuntu-latest <%- with job_name = 'Build tutorial generator' -%> - <%- from 'build_tutorial_generator_steps' import output -%> + <%- from 'build_tutorial_generator_steps' import output -%> <<- output | indent(4) ->> <%- endwith %> @@ -54,13 +52,13 @@ jobs: - build_clis_linux - build_tutorial_generator <%- with job_name = 'Check if up to date' -%> - <%- from 'is_up_to_date_steps' import output -%> + <%- from 'is_up_to_date_steps' import output -%> <<- output | indent(4) >> <%- endwith %> build_docs: runs-on: ubuntu-latest <%- with job_name = 'Build docs' %> - <%- from 'build_docs_steps' import output %> + <%- from 'build_docs_steps' import output %> <<- output | indent(4) >> <%- endwith %>