Enable linting #13
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.head_ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
name: Lint | |
uses: ./.github/workflows/lint.yml | |
files_changed: | |
name: Determine files changed | |
needs: lint | |
runs-on: ubuntu-latest | |
# Map a step output to a job output, this allows other jobs to be gated on the filter results | |
outputs: | |
extra_push: ${{ steps.filter.outputs.extra_push }} | |
extra_pull_request: ${{ steps.filter.outputs.extra_pull_request }} | |
stackhpc: ${{ steps.filter.outputs.stackhpc }} | |
trivvyscan: ${{ steps.filter.outputs.trivvyscan }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Paths Filter | |
# For safety using commit of dorny/paths-filter@v3 | |
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 | |
id: filter | |
with: | |
list-files: 'json' | |
filters: | | |
extra_push: | |
- 'environments/.stackhpc/tofu/cluster_image.auto.tfvars.json' | |
- 'ansible/roles/doca/**' | |
- 'ansible/roles/cuda/**' | |
- 'ansible/roles/slurm_recompile/**' # runs on cuda group | |
- 'ansible/roles/lustre/**' | |
- '.github/workflows/extra.yml' | |
extra_pull_request: | |
- 'environments/.stackhpc/tofu/cluster_image.auto.tfvars.json' | |
- 'ansible/roles/doca/**' | |
- 'ansible/roles/cuda/**' | |
- 'ansible/roles/lustre/**' | |
- '.github/workflows/extra.yml' | |
stackhpc: | |
- '**' | |
- '!dev/**' | |
- 'dev/setup-env.sh' | |
- '!docs/**' | |
- '!README.md' | |
- '!.gitignore' | |
- '!.github/workflows/' | |
- '.github/workflows/stackhpc' | |
trivvyscan: | |
- 'environments/.stackhpc/tofu/cluster_image.auto.tfvars.json' | |
- name: Paths Filter Result | |
run: > | |
echo '{ "extra_push_files": ${{ steps.filter.outputs.extra_push_files }} }' | jq -r '.'; | |
echo '{ "extra_pull_request_files": ${{ steps.filter.outputs.extra_pull_request_files }} }' | jq -r '.'; | |
echo '{ "stackhpc_files": ${{ steps.filter.outputs.stackhpc_files }} }' | jq -r '.'; | |
echo '{ "trivvyscan_files": ${{ steps.filter.outputs.trivvyscan_files }} }' | jq -r '.' | |
extra: | |
name: Test extra build | |
needs: files_changed | |
#if: | | |
# needs.files_changed.outputs.should_skip != 'true' && | |
# (( github.event_name != 'pull_request' && !fromJSON(needs.files_changed.outputs.paths_result).extra_push.should_skip ) || | |
# ( github.event_name == 'pull_request' && !fromJSON(needs.files_changed.outputs.paths_result).extra_pull_request.should_skip )) | |
if: | | |
github.event_name != 'pull_request' && needs.files_changed.outputs.extra_push == 'true' || | |
github.event_name == 'pull_request' && needs.files_changed.outputs.extra_pull_request == 'true' | |
#uses: ./.github/workflows/extra.yml | |
steps: # TEST | |
- name: Test extra build... | |
uses: jakejarvis/wait-action@master | |
with: | |
time: '120s' | |
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 | |
if: | | |
needs.files_changed.outputs.stackhpc == 'true' | |
#uses: ./.github/workflows/stackhpc.yml | |
steps: # TEST | |
- name: Test deployment and reimage on OpenStack... | |
uses: jakejarvis/wait-action@master | |
with: | |
time: '120s' | |
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 | |
if: | | |
github.event_name == 'pull_request' && | |
needs.files_changed.outputs.trivvyscan == 'true' | |
#uses: ./.github/workflows/trivvyscan.yml | |
steps: # TEST | |
- name: Trivy scan image for vulnerabilities... | |
uses: jakejarvis/wait-action@master | |
with: | |
time: '120s' | |
runs-on: ubuntu-latest # TEST | |
#secrets: inherit |