Update GH workflow so linting always runs befor any other jobs #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | ||
name: Test on push and pull request | ||
permissions: | ||
actions: write | ||
contents: read | ||
packages: write | ||
# To report GitHub Actions status checks | ||
statuses: write | ||
id-token: write | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.build.image_name }} # to branch/PR + OS | ||
cancel-in-progress: true | ||
jobs: | ||
lint: | ||
name: Lint | ||
uses: ./.github/workflows/lint.yml | ||
files_changed: | ||
name: Determine files changed | ||
needs: lint | ||
# continue-on-error: true # Uncomment once integration is finished | ||
runs-on: ubuntu-latest | ||
# Map a step output to a job output | ||
outputs: | ||
should_skip: ${{ steps.skip_check.outputs.should_skip }} | ||
paths_result: ${{ steps.skip_check.outputs.paths_result }} | ||
steps: | ||
- id: skip_check | ||
# For security we use the commit of fkirc/skip-duplicate-actions@v5 | ||
uses: fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf | ||
with: | ||
cancel_others: true | ||
paths_filter: | | ||
extra: | ||
paths: | ||
- 'environments/.stackhpc/tofu/cluster_image.auto.tfvars.json' | ||
- 'ansible/roles/doca/**' | ||
- 'ansible/roles/cuda/**' | ||
- 'ansible/roles/lustre/**' | ||
- '.github/workflows/extra.yml' | ||
stackhpc: | ||
paths: | ||
- '**' | ||
- '!dev/**' | ||
- 'dev/setup-env.sh' | ||
- '!docs/**' | ||
- '!README.md' | ||
- '!.gitignore' | ||
- '!.github/workflows/' | ||
- '.github/workflows/stackhpc' | ||
trivvyscan: | ||
paths: | ||
- 'environments/.stackhpc/tofu/cluster_image.auto.tfvars.json' | ||
extra: | ||
name: Test extra build | ||
needs: files_changed | ||
if: needs.files_changed.outputs.should_skip != 'true' && | ||
!fromJSON(needs.files_changed.outputs.paths_result).extra.should_skip | ||
#uses: ./.github/workflows/extra.yml | ||
steps: # TEST | ||
- run: echo "Running: Test extra build..." && sleep 30 # TEST | ||
runs-on: ubuntu-latest # TEST | ||
#secrets: inherit | ||
stackhpc: | ||
name: Test deployment and reimage on OpenStack | ||
needs: files_changed | ||
if: needs.files_changed.outputs.should_skip != 'true' && | ||
!fromJSON(needs.files_changed.outputs.paths_result).stackhpc.should_skip | ||
#uses: ./.github/workflows/stackhpc.yml | ||
steps: # TEST | ||
- run: echo "Running: Test deployment and reimage on OpenStack..." && sleep 30 # TEST | ||
runs-on: ubuntu-latest # TEST | ||
#secrets: inherit | ||
trivvyscan: | ||
name: Trivy scan image for vulnerabilities | ||
needs: files_changed | ||
if: github.event_name == 'pull_request' && | ||
needs.files_changed.outputs.should_skip != 'true' && | ||
!fromJSON(needs.files_changed.outputs.paths_result).trivvyscan.should_skip | ||
#uses: ./.github/workflows/trivvyscan.yml | ||
steps: # TEST | ||
- run: echo "Running: Trivy scan image for vulnerabilities..." && sleep 30 # TEST | ||
runs-on: ubuntu-latest # TEST | ||
#secrets: inherit |