Skip to content

Commit

Permalink
Always test for job ID
Browse files Browse the repository at this point in the history
  • Loading branch information
omus committed Sep 13, 2024
1 parent 52ae847 commit f6af6e7
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ jobs:
env:
output: ${{ steps.job.outputs.name }}
expected: test-empty-name # ${{ github.job }}
- name: Test job ID
run: |
[[ "${job_id}" =~ ^[0-9]+$ ]] || exit 1
env:
job_id: ${{ steps.job.outputs.id }}

test-null-name:
name: null
Expand All @@ -75,6 +80,11 @@ jobs:
env:
output: ${{ steps.job.outputs.name }}
expected: test-null-name # ${{ github.job }}
- name: Test job ID
run: |
[[ "${job_id}" =~ ^[0-9]+$ ]] || exit 1
env:
job_id: ${{ steps.job.outputs.id }}

test-false-name:
name: false
Expand All @@ -90,6 +100,11 @@ jobs:
env:
output: ${{ steps.job.outputs.name }}
expected: false # ${{ github.job }}
- name: Test job ID
run: |
[[ "${job_id}" =~ ^[0-9]+$ ]] || exit 1
env:
job_id: ${{ steps.job.outputs.id }}

test-matrix:
name: Matrix
Expand Down Expand Up @@ -117,6 +132,11 @@ jobs:
env:
output: ${{ steps.job.outputs.name }}
expected: Matrix (${{ matrix.build.name }}, ${{ matrix.build.repo }}, ${{ matrix.version }})
- name: Test job ID
run: |
[[ "${job_id}" =~ ^[0-9]+$ ]] || exit 1
env:
job_id: ${{ steps.job.outputs.id }}
- name: Test job name is distinct
run: |
jobs="$(gh api -X GET "/repos/{owner}/{repo}/actions/runs/${run_id:?}/attempts/${run_attempt:?}/jobs")"
Expand Down Expand Up @@ -151,6 +171,11 @@ jobs:
env:
output: ${{ steps.job.outputs.name }}
expected: Matrix Expression - ${{ github.event_name }} - - ${{ matrix.index }} - ${{ strategy.job-index }}
- name: Test job ID
run: |
[[ "${job_id}" =~ ^[0-9]+$ ]] || exit 1
env:
job_id: ${{ steps.job.outputs.id }}
- name: Test job name is distinct
run: |
jobs="$(gh api -X GET "/repos/{owner}/{repo}/actions/runs/${run_id:?}/attempts/${run_attempt:?}/jobs")"
Expand Down

0 comments on commit f6af6e7

Please sign in to comment.