Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: build and test #210

Merged
merged 5 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Build and Test

on:
push:

jobs:
call-build:
uses: ./.github/workflows/docker-build.yaml
secrets: inherit
call-test:
uses: ./.github/workflows/pytest.yaml
needs: call-build
4 changes: 3 additions & 1 deletion .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Workflows Docker Build

on:
push:
workflow_call:

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -92,9 +92,11 @@ jobs:
image: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.TOOL }}:local
args: --file=${{ matrix.image }}/Dockerfile
- name: Clean Snyk SARIF file
continue-on-error: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch on both of these. Definitely the preferred behavior.

run: |
sed -i 's/"security-severity": "null"/"security-severity": "0"/g' snyk.sarif
- name: Upload result to GitHub Code Scanning
continue-on-error: true
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: snyk.sarif
Expand Down
15 changes: 1 addition & 14 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
name: pytest-workflow Check

on:
workflow_run:
workflows: ["Workflows Docker Build"]
types:
- completed
workflow_call:

jobs:
on-success:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- run: echo 'The build workflow passed, starting tests'
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- run: echo 'The build workflow failed, skipping tests' && exit 1
list-tags:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's important, but I wonder if the tag list could be passed between the workflows. It's cheap to recompute, so it's more a curiosity.

runs-on: ubuntu-latest
outputs:
Expand Down