Commit 931025f 1 parent e4f1d25 commit 931025f Copy full SHA for 931025f
File tree 3 files changed +45
-50
lines changed
3 files changed +45
-50
lines changed Original file line number Diff line number Diff line change 9
9
- main
10
10
11
11
jobs :
12
- build :
12
+ test :
13
13
runs-on : ubuntu-latest
14
14
steps :
15
15
- name : Checkout Code
16
16
uses : actions/checkout@v2
17
- - name : Build Application
18
- run : echo "Building the application"
19
-
20
- final_job :
21
- runs-on : ubuntu-latest
22
- needs :
23
- - build
24
- steps :
25
- - name : Checkout Code
26
- uses : actions/checkout@v2
27
-
28
- - name : Setup Node.js
29
- uses : actions/setup-node@v3
30
- with :
31
- node-version : ' 18'
32
-
33
- - name : Install Dependencies
34
- run : npm install @google-cloud/logging
35
-
36
- - name : Final Job
37
- env :
38
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
39
- GCP_CREDENTIALS : ${{ secrets.GCP_CREDENTIALS }}
40
- run : |
41
- echo "Determining which workflow triggered the Final Job..."
42
- node source/dump-ci-stats-to-gcp-logs.js "Build Job"
17
+ - name : Test Application
18
+ run : echo "Testing the application"
19
+
20
+ call_final_job :
21
+ needs : test # Ensures this job runs after the 'test' job
22
+ uses : ./.github/workflows/dump_ci_stats.yml # Calls the reusable workflow
23
+ with :
24
+ workflow_name : " Build Job"
Original file line number Diff line number Diff line change
1
+ name : Dum GH CI Stats
2
+
3
+ on :
4
+ workflow_call : # This allows the workflow to be reused
5
+ inputs :
6
+ workflow_name :
7
+ description : ' Name of the CI workflow that triggered this job'
8
+ required : true
9
+ type : string
10
+
11
+ jobs :
12
+ final_job :
13
+ runs-on : ubuntu-latest
14
+ steps :
15
+ - name : Checkout Code
16
+ uses : actions/checkout@v2
17
+
18
+ - name : Set up Node.js
19
+ uses : actions/setup-node@v3
20
+ with :
21
+ node-version : ' 18'
22
+
23
+ - name : Install GCP Logging Client
24
+ run : npm install @google-cloud/logging
25
+
26
+ - name : Run Final Job and Send Logs to GCP
27
+ env :
28
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
29
+ GCP_CREDENTIALS : ${{ secrets.GCP_CREDENTIALS }}
30
+ run : |
31
+ node source/dump-ci-stats-to-gcp-logs.js "${{ inputs.workflow_name }}"
Original file line number Diff line number Diff line change 16
16
uses : actions/checkout@v2
17
17
- name : Test Application
18
18
run : echo "Testing the application"
19
-
20
- final_job :
21
- runs-on : ubuntu-latest
22
- needs :
23
- - test
24
- steps :
25
- - name : Checkout Code
26
- uses : actions/checkout@v2
27
-
28
- - name : Setup Node.js
29
- uses : actions/setup-node@v3
30
- with :
31
- node-version : ' 18'
32
-
33
- - name : Install Dependencies
34
- run : npm install @google-cloud/logging
35
19
36
- - name : Final Job
37
- env :
38
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
39
- GCP_CREDENTIALS : ${{ secrets.GCP_CREDENTIALS }}
40
- run : |
41
- echo "Determining which workflow triggered the Final Job..."
42
- node source/dump-ci-stats-to-gcp-logs.js "Test Job"
20
+ call_final_job :
21
+ needs : test # Ensures this job runs after the 'test' job
22
+ uses : ./.github/workflows/dump_ci_stats.yml # Calls the reusable workflow
23
+ with :
24
+ workflow_name : " Test Job"
You can’t perform that action at this time.
0 commit comments