1
1
name : Test Azimuth deployment
2
2
3
- on :
3
+ permissions :
4
+ contents : read
5
+ packages : write
6
+ # To report GitHub Actions status checks
7
+ statuses : write
8
+ id-token : write
9
+
10
+ on : # yamllint disable-line rule:truthy
4
11
pull_request :
5
12
types :
6
13
- opened
9
16
- reopened
10
17
branches :
11
18
- main
12
- paths-ignore :
13
- # Ignore any changes that are not actually code changes
14
- - .gitignore
15
- - CODEOWNERS
16
- - LICENSE
17
- - README.md
18
- - .github/release.yml
19
- - .github/workflows/update-dependencies.yml
20
- # Ignore any changes that only affect the HA install
21
- - playbooks/deploy_capi_mgmt.yml
22
- - playbooks/provision_capi_mgmt.yml
23
- - playbooks/restore.yml
24
- - roles/capi_cluster/**
25
- - roles/velero/**
26
19
27
20
# Use the head ref for workflow concurrency, with cancellation
28
21
# This should mean that any previous workflows for a PR get cancelled when a new commit is pushed
@@ -33,50 +26,66 @@ concurrency:
33
26
jobs :
34
27
# This job exists so that PRs from outside the main repo are rejected
35
28
fail_on_remote :
29
+ name : Fail on Remote
36
30
runs-on : ubuntu-latest
37
31
steps :
38
32
- name : PR must be from a branch in the azimuth-cloud/ansible-collection-azimuth-ops repo
39
- run : exit ${{ github.repository == 'azimuth-cloud/ansible-collection-azimuth-ops' && '0' || '1' }}
33
+ run : |
34
+ if [ "${{ github.repository }}" != "azimuth-cloud/ansible-collection-azimuth-ops" ]; then
35
+ exit 1
36
+ fi
37
+ lint :
38
+ name : Lint
39
+ uses : ./.github/workflows/lint.yml
40
+ needs :
41
+ - fail_on_remote
40
42
41
- run_azimuth_tests :
42
- needs : [fail_on_remote]
43
+ files_changed :
44
+ name : Detect Files Changed
45
+ needs :
46
+ - fail_on_remote
47
+ - lint
43
48
runs-on : ubuntu-latest
49
+ # Map a step output to a job output, this allows other jobs to be gated on the filter results
50
+ outputs :
51
+ paths : ${{ steps.filter.outputs.paths }}
44
52
steps :
45
- # Check out the configuration repository
46
- - name : Set up Azimuth environment
47
- uses : azimuth-cloud/azimuth-config/.github/actions/setup@devel
48
- with :
49
- os-clouds : ${{ secrets.OS_CLOUDS }}
50
- environment-prefix : ops-ci
51
- azimuth-ops-version : ${{ github.event.pull_request.head.sha }}
52
- target-cloud : ${{ vars.TARGET_CLOUD }}
53
- # Remove when https://github.com/stackhpc/azimuth-config/pull/129 merges
54
- extra-vars : |
55
- generate_tests_caas_default_test_case_enabled: false
56
- generate_tests_caas_test_case_workstation_enabled: true
57
- generate_tests_caas_test_case_slurm_enabled: true
58
- generate_tests_caas_test_case_repo2docker_enabled: true
59
- generate_tests_caas_test_case_rstudio_enabled: true
60
- generate_tests_kubernetes_test_cases_latest_only: true
61
- generate_tests_kubernetes_apps_default_test_case_enabled: false
62
- generate_tests_kubernetes_apps_test_case_jupyterhub_enabled: true
63
- generate_tests_kubernetes_apps_test_case_daskhub_enabled: true
64
- # Test Flux install in CI even when disabled in default config
65
- flux_enabled: true
66
- # GitHub terminates jobs after 6 hours
67
- # We don't want jobs to acquire the lock then get timed out before they can finish
68
- # So wait a maximum of 3 hours to acquire the lock, leaving 3 hours for other tasks in the job
69
- timeout-minutes : 180
53
+ - name : Checkout
54
+ uses : actions/checkout@v4
70
55
71
- # Provision Azimuth using the azimuth-ops version under test
72
- - name : Provision Azimuth
73
- uses : azimuth-cloud/azimuth-config/.github/actions/provision@devel
74
-
75
- # # Run the tests
76
- - name : Run Azimuth tests
77
- uses : azimuth-cloud/azimuth-config/.github/actions/test@devel
56
+ - name : Paths Filter
57
+ # For safety using commit of dorny/paths-filter@v3
58
+ uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
59
+ id : filter
60
+ with :
61
+ # Default predicate is 'some' which gives a match if any one filter matches.
62
+ # Change the predicate to 'every' so the file has to match all filters,
63
+ # to model 'paths-ignore' we match only if we've exluded all unwanted files.
64
+ predicate-quantifier : ' every'
65
+ filters : |
66
+ paths:
67
+ # Ignore any changes that are not actually code changes
68
+ - "!.gitignore"
69
+ - "!CODEOWNERS"
70
+ - "!LICENSE"
71
+ - "!README.md"
72
+ - "!.github/release.yml"
73
+ - "!.github/workflows/update-dependencies.yml"
74
+ # Ignore any changes that only affect the HA install
75
+ - "!playbooks/deploy_capi_mgmt.yml"
76
+ - "!playbooks/provision_capi_mgmt.yml"
77
+ - "!playbooks/restore.yml"
78
+ - "!roles/capi_cluster/**"
79
+ - "!roles/velero/**"
78
80
79
- # Tear down the environment
80
- - name : Destroy Azimuth
81
- uses : azimuth-cloud/azimuth-config/.github/actions/destroy@devel
82
- if : ${{ always() }}
81
+ run_azimuth_tests :
82
+ # Use the output of the above filter to check if the files listed under "paths" have changed.
83
+ # We can negate this check to run an alternative job,
84
+ # we can add additional filters like "paths" and action on those.
85
+ # Example: https://github.com/getsentry/sentry/blob/2ebe01feab863d89aa7564e6d243b6d80c230ddc/.github/workflows/backend.yml#L36
86
+ name : Run Azimuth Tests
87
+ needs :
88
+ - files_changed
89
+ if : needs.files_changed.outputs.paths == 'true'
90
+ uses : ./.github/workflows/test-azimuth.yml
91
+ secrets : inherit
0 commit comments