@@ -4,63 +4,51 @@ name: modules
4
4
5
5
on :
6
6
push :
7
- branches : [main]
7
+ branches : [ main ]
8
8
paths :
9
9
- " modules/**"
10
10
pull_request :
11
- branches : [main]
11
+ branches : [ main ]
12
12
paths :
13
13
- " modules/**"
14
14
15
- permissions :
16
- actions : write # needed for self-cancellation
17
-
18
15
jobs :
19
- test :
20
- strategy :
21
- fail-fast : false
22
- matrix :
23
- python-version : ["3.11"]
24
- module :
25
- - arangodb
26
- - azurite
27
- - clickhouse
28
- - elasticsearch
29
- - google
30
- - kafka
31
- - keycloak
32
- - localstack
33
- - minio
34
- - mongodb
35
- - mssql
36
- - mysql
37
- - neo4j
38
- - nginx
39
- - opensearch
40
- - oracle
41
- - postgres
42
- - rabbitmq
43
- - redis
44
- - selenium
45
- - k3s
16
+ track-modules :
46
17
runs-on : ubuntu-latest
47
18
steps :
48
19
- name : Checkout contents
49
20
uses : actions/checkout@v4
21
+ with :
22
+ fetch-depth : 0 # recommended by tj-actions/changed-files
50
23
- name : Get changed files
51
- id : changes-for-module
24
+ id : changed-files
52
25
uses : tj-actions/changed-files@v42
53
26
with :
54
- files : |
55
- modules/${{ matrix.module }}/**
56
- - name : Exit early, nothing to do
57
- if : ${{ steps.changes-for-module.outputs.any_changed == 'false' }}
27
+ path : " ./modules"
28
+ diff_relative : true
29
+ dir_names : true
30
+ dir_names_exclude_current_dir : true
31
+ json : true
32
+ - name : Compute modules from files
33
+ id : compute-changes
58
34
run : |
59
- # cancel and wait for run to end
60
- gh run cancel ${{ github.run_id }}
61
- gh run watch ${{ github.run_id }}
62
- env :
63
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
35
+ modules=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | jq '.[] | split("/") | first' | jq -s -c '. | unique')
36
+ echo "computed_modules=$modules"
37
+ echo "computed_modules=$modules" >> $GITHUB_OUTPUT
38
+ outputs :
39
+ changed_modules : ${{ steps.compute-changes.outputs.computed_modules }}
40
+ test :
41
+ needs : [track-modules]
42
+ if : ${{ needs.track-modules.outputs.changed_modules != '[]' }}
43
+ strategy :
44
+ fail-fast : false
45
+ matrix :
46
+ python-version : [ "3.11" ]
47
+ module : ${{ fromJSON(needs.track-modules.outputs.changed_modules) }}
48
+ runs-on : ubuntu-latest
49
+ steps :
50
+ - name : Checkout contents
51
+ uses : actions/checkout@v4
64
52
- name : Set up Python
65
53
uses : ./.github/actions/setup-env
66
54
with :
0 commit comments