Skip to content

Commit

Permalink
Update integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
omus committed Aug 16, 2024
1 parent bd7ffad commit 50db99d
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,16 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./job-context/
id: job-context
id: job
- name: Matches expected name
run: '[[ "${output}" == "${expected}" ]] || exit 1'
env:
output: ${{ steps.job-context.outputs.job-name }}
output: ${{ steps.job.outputs.name }}
expected: "Job Name"
- name: Has Job ID
run: '[[ -n "${job_id}" ]] || exit 1'
env:
job_id: ${{ steps.job.outputs.id }}

test-job-name-matrix:
name: Job Name
Expand All @@ -267,11 +271,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./job-context/
id: job-context
id: job
- name: Matches expected name
run: '[[ "${output}" == "${expected}" ]] || exit 1'
env:
output: ${{ steps.job-context.outputs.job-name }}
output: ${{ steps.job.outputs.name }}
expected: "Job Name (${{ matrix.build.name }}, ${{ matrix.build.repo }}, ${{ matrix.version }})"
- name: Matches GitHub API name
run: |
Expand All @@ -284,7 +288,7 @@ jobs:
GH_TOKEN: ${{ github.token }}
run_id: ${{ github.run_id }}
run_attempt: ${{ github.run_attempt }}
job_name: ${{ steps.job-context.outputs.job-name }}
job_name: ${{ steps.job.outputs.name }}

test-job-name-matrix-expr:
# TODO: Using `github.job` with any expressions results in it being empty
Expand All @@ -306,7 +310,7 @@ jobs:
- name: Matches expected name
run: '[[ "${output}" == "${expected}" ]] || exit 1'
env:
output: ${{ steps.job-context.outputs.job-name }}
output: ${{ steps.job.outputs.name }}
expected: ${{ github.event_name }} - - ${{ matrix.index }} - ${{ strategy.job-index }}
- name: Matches GitHub API name
run: |
Expand All @@ -319,7 +323,7 @@ jobs:
GH_TOKEN: ${{ github.token }}
run_id: ${{ github.run_id }}
run_attempt: ${{ github.run_attempt }}
job_name: ${{ steps.job-context.outputs.job-name }}
job_name: ${{ steps.job.outputs.name }}

test-job-name-ambiguous:
name: ${{ github.job }}
Expand All @@ -336,16 +340,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./job-context/
id: job-context
- name: Matches expected name
run: '[[ "${output}" == "${expected}" ]] || exit 1'
env:
output: ${{ steps.job-context.outputs.job-name }}
expected: ${{ github.job }}
- name: Matches multiple jobs
run: |
[[ $(jq length <<<"${job_ids}") -eq 2 ]] || exit 1
[[ -z "${job_id}" ]] || exit 1
env:
job_ids: ${{ steps.job-context.outputs.job-ids }}
job_id: ${{ steps.job-context.outputs.job-id }}
id: job
continue-on-error: true
- name: Action failed
if: ${{ steps.job.outcome != 'failure' }}
run: exit 1

0 comments on commit 50db99d

Please sign in to comment.