Skip to content

Commit

Permalink
Update check for needs, rename build to test (#188)
Browse files Browse the repository at this point in the history
* Update check for needs, rename build to test

* pretty
  • Loading branch information
cidrblock authored May 30, 2024
1 parent 7f538b4 commit bbcab2a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/tox-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ name: tox-check

on:
workflow_call:
inputs:
jobs_producing_coverage:
default: 5
description: Number of jobs producing coverage.xml files
required: false
type: number
test_need_context:
description: The needs context from the tests
required: true
type: string

jobs:
check:
Expand Down Expand Up @@ -37,8 +47,9 @@ jobs:
name: logs.zip

- name: Check for expected number of coverage.xml reports
env:
JOBS_PRODUCING_COVERAGE: ${{ inputs.jobs_producing_coverage }}
run: |
JOBS_PRODUCING_COVERAGE=5
if [ "$(find . -name coverage.xml | wc -l | bc)" -ne "${JOBS_PRODUCING_COVERAGE}" ]; then
echo "::error::Number of coverage.xml files was not the expected one (${JOBS_PRODUCING_COVERAGE}): $(find . -name coverage.xml |xargs echo)"
exit 1
Expand All @@ -58,7 +69,7 @@ jobs:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
jobs: ${{ inputs.test_need_context }}

- name: Delete Merged Artifacts
uses: actions/upload-artifact/merge@v4
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: tox-build
name: tox-test

on:
workflow_call:
Expand All @@ -13,7 +13,7 @@ env:
PY_COLORS: 1

jobs:
build:
test:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os || 'ubuntu-22.04' }}
defaults:
Expand Down

0 comments on commit bbcab2a

Please sign in to comment.