Skip to content

Commit 0aade54

Browse files
committed
build: consolidate github workflows
1 parent 483ea37 commit 0aade54

File tree

3 files changed

+90
-119
lines changed

3 files changed

+90
-119
lines changed

.github/workflows/ci.yaml

Lines changed: 62 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,40 @@ on:
66
- main
77
workflow_dispatch:
88
inputs:
9-
skip_coveralls:
10-
description: "Skip Coveralls"
9+
skip_build_docs:
10+
description: "Skip build docs"
1111
type: boolean
1212
default: false
13-
skip_gas:
14-
description: "Skip push"
13+
skip_build_lib:
14+
description: "Skip build lib"
15+
type: boolean
16+
default: false
17+
skip_deploy_docs:
18+
description: "Skip deploy docs"
19+
type: boolean
20+
default: false
21+
skip_deploy_lib_ci:
22+
description: "Skip deploy lib (CI)"
23+
type: boolean
24+
default: false
25+
skip_deploy_lib_release:
26+
description: "Skip deploy lib (release)"
27+
type: boolean
28+
default: false
29+
skip_qa_coveralls:
30+
description: "Skip QA Coveralls"
31+
type: boolean
32+
default: false
33+
skip_qa_sonarqube:
34+
description: "Skip QA SonarQube"
1535
type: boolean
1636
default: false
1737
skip_release:
1838
description: "Skip release"
1939
type: boolean
2040
default: true
21-
skip_sonarqube:
22-
description: "Skip SonarQube"
23-
type: boolean
24-
default: false
25-
skip_tests:
26-
description: "Skip tests"
41+
skip_test:
42+
description: "Skip test"
2743
type: boolean
2844
default: false
2945

@@ -49,64 +65,71 @@ jobs:
4965
GCLOUD_PROJECT_ID: ${{secrets.GCLOUD_PROJECT_ID}}
5066
GCLOUD_PROJECT_NR: ${{secrets.GCLOUD_PROJECT_NR}}
5167
steps:
68+
- id: release
69+
name: Release
70+
if: ${{ !github.event.inputs.skip_release }}
71+
uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4
72+
with:
73+
release-type: node
5274
- id: checkout
5375
name: Checkout
54-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 # Use v3 or later
76+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
5577
with:
5678
persist-credentials: false
5779
token: ${{ secrets.GITHUB_TOKEN }}
5880
fetch-depth: 0
59-
- id: nodejs
60-
name: Use Node.js
61-
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4 # Use v3 or later
81+
- id: setup-nodejs
82+
name: Setup Node.js
83+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
6284
with:
6385
node-version: 22.x
6486
cache: "npm"
65-
- id: build
66-
name: Build
87+
- id: build-lib
88+
if: ${{ !github.event.inputs.skip_build_lib }}
89+
name: Build lib
6790
run: npm run ci:build
6891
- id: test
69-
if: ${{ !github.event.inputs.skip_tests }}
92+
if: ${{ !github.event.inputs.skip_test }}
7093
name: Test
7194
run: npm run ci:test
72-
- id: docs
95+
- id: build-docs
96+
if: ${{ !github.event.inputs.skip_build_docs }}
7397
name: Build docs
7498
run: npm run ci:docs
75-
- name: Release Please
76-
if: ${{ !github.event.inputs.skip_release }}
77-
id: release
78-
uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4
79-
with:
80-
release-type: node # Or the appropriate release type for your project
81-
- id: coveralls
82-
if: ${{ !github.event.inputs.skip_coveralls }}
83-
name: Coveralls
99+
- id: qa-coveralls
100+
if: ${{ !github.event.inputs.skip_qa_coveralls }}
101+
name: QA Coveralls
84102
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2
85-
- id: sonarqube
86-
if: ${{ !github.event.inputs.skip_sonarqube }}
87-
name: SonarQube Scan
103+
- id: qa-sonarqube
104+
if: ${{ !github.event.inputs.skip_qa_sonarqube }}
105+
name: QA SonarQube
88106
uses: SonarSource/sonarqube-scan-action@0303d6b62e310685c0e34d0b9cde218036885c4d # v5
89107
env:
90108
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91109
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
92-
# SONAR_PROJECT_VERSION: ${{ steps.release-status.outputs.new_release_published == 'true' && steps.release-status.outputs.new_release_version || '' }} Remove this line
93-
- id: push-gas
94-
if: ${{ !github.event.inputs.skip_gas }}
95-
name: Push to GAS
110+
- id: deploy-lib-ci
111+
if: ${{ !github.event.inputs.skip_deploy_lib_ci }}
112+
name: Deploy Lib (CI)
96113
run: |
97114
npm run push
98115
echo "new_gas_version=$(cat build/gas/lib-version.txt)" >> "${GITHUB_OUTPUT}"
99-
- id: deploy-lib
100-
if: ${{ !github.event.inputs.skip_release && steps.release.outputs.release_created }} # Check if a release was created
101-
name: Deploy Lib
116+
- id: deploy-lib-release
117+
if: ${{ !github.event.inputs.skip_deploy_lib_release && !github.event.inputs.skip_release && steps.release.outputs.release_created }} # Check if a release was created
118+
name: Deploy Lib (Release)
102119
run: npm run deploy
103120
env:
104-
CLASP_DEPLOYMENT_NAME: ${{ steps.release.outputs.tag_name }} # Use the tag name from release-please
121+
CLASP_DEPLOYMENT_NAME: ${{ steps.release.outputs.tag_name }}
105122
- id: update-release-notes
106123
if: ${{ !github.event.inputs.skip_release && steps.release.outputs.release_created }} # Check if a release was created
107124
name: Update Release Notes
108125
run: |
109126
npm run release:update
110127
env:
111-
CLASP_DEPLOYMENT_NAME: ${{ steps.release.outputs.tag_name }} # Use the tag name from release-please
128+
CLASP_DEPLOYMENT_NAME: ${{ steps.release.outputs.tag_name }}
112129
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130+
- id: deploy-docs
131+
if: ${{ !github.event.inputs.skip_deploy_docs }}
132+
name: Deploy docs
133+
uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4
134+
with:
135+
folder: docs/build

.github/workflows/docs.yaml

Lines changed: 0 additions & 62 deletions
This file was deleted.

.github/workflows/pr.yaml

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,24 @@ on:
77
types: [opened, synchronize, reopened]
88
workflow_dispatch:
99
inputs:
10-
skip_coveralls:
11-
description: "Skip Coveralls"
10+
skip_build_docs:
11+
description: "Skip build docs"
1212
type: boolean
1313
default: false
14-
skip_sonarqube:
15-
description: "Skip SonarQube"
14+
skip_build_lib:
15+
description: "Skip build lib"
1616
type: boolean
1717
default: false
18-
skip_tests:
19-
description: "Skip tests"
18+
skip_qa_coveralls:
19+
description: "Skip QA Coveralls"
20+
type: boolean
21+
default: false
22+
skip_qa_sonarqube:
23+
description: "Skip QA SonarQube"
24+
type: boolean
25+
default: false
26+
skip_test:
27+
description: "Skip test"
2028
type: boolean
2129
default: false
2230

@@ -34,29 +42,31 @@ jobs:
3442
persist-credentials: false
3543
token: ${{ secrets.GITHUB_TOKEN }}
3644
fetch-depth: 0
37-
- id: nodejs
38-
name: Use Node.js
45+
- id: setup-nodejs
46+
name: Setup Node.js
3947
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
4048
with:
4149
node-version: 22.x
4250
cache: "npm"
43-
- id: build
44-
name: Build
51+
- id: build-lib
52+
if: ${{ !github.event.inputs.skip_build_lib }}
53+
name: Build lib
4554
run: npm run ci:build
4655
- id: test
47-
if: ${{ !github.event.inputs.skip_tests }}
56+
if: ${{ !github.event.inputs.skip_test }}
4857
name: Test
4958
run: npm run ci:test
50-
- id: docs
59+
- id: build-docs
60+
if: ${{ !github.event.inputs.skip_build_docs }}
5161
name: Build docs
5262
run: npm run ci:docs
53-
- id: coveralls
54-
if: ${{ !github.event.inputs.skip_coveralls }}
55-
name: Coveralls
63+
- id: qa-coveralls
64+
if: ${{ !github.event.inputs.skip_qa_coveralls }}
65+
name: QA Coveralls
5666
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2
57-
- id: sonarqube
58-
if: ${{ !github.event.inputs.skip_sonarqube }}
59-
name: SonarQube Scan
67+
- id: qa-sonarqube
68+
if: ${{ !github.event.inputs.skip_qa_sonarqube }}
69+
name: QA SonarQube
6070
uses: SonarSource/sonarqube-scan-action@0303d6b62e310685c0e34d0b9cde218036885c4d # v5
6171
env:
6272
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)