Skip to content

Commit a2f89b2

Browse files
authored
♻️ use centralized workflows (#339)
1 parent 980fe9a commit a2f89b2

File tree

8 files changed

+62
-40
lines changed

8 files changed

+62
-40
lines changed
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
11
#
2-
# Make sure dependencies use compatible licenses.
2+
# Run static code analysis.
33
#
4-
name: License Check
4+
name: Static Analysis
55

66
on:
7-
- pull_request
7+
workflow_call:
88

99
jobs:
10-
license-check:
11-
name: Check licenses
10+
static-check:
11+
name: Run Static Analysis
1212
runs-on: ubuntu-latest
1313

1414
steps:
1515
- name: Check out Git repository
1616
uses: actions/checkout@v4
1717

1818
- name: Set up Node.js
19-
uses: actions/setup-node@v3
19+
uses: actions/setup-node@v4
2020
with:
2121
node-version: 18
2222
cache: "npm"
2323

2424
- name: Install Node.js dependencies
2525
run: npm ci
2626

27+
- name: Test lint
28+
run: npm run lint
29+
2730
- name: Install NPM License Checker
2831
run: npm install -g license-checker
2932

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
name: Test Code Samples
2+
23
on:
3-
pull_request:
4-
schedule:
5-
- cron: '0 23 * * *'
6-
# Allow running this workflow manually from the Actions tab
4+
workflow_call:
75
workflow_dispatch:
86

97
jobs:
@@ -24,7 +22,7 @@ jobs:
2422
submodules: recursive
2523

2624
- name: Set up Node.js ${{ matrix.node-version }}
27-
uses: actions/setup-node@v3
25+
uses: actions/setup-node@v4
2826
with:
2927
node-version: ${{ matrix.node-version }}
3028
cache: "npm"
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
#
2+
# Run integration tests.
3+
#
14
name: Integration Test
25

36
on:
4-
- push
7+
workflow_call:
58

69
jobs:
710
run-tests:
@@ -26,7 +29,7 @@ jobs:
2629
submodules: recursive
2730

2831
- name: Set up Node.js ${{ matrix.node-version }}
29-
uses: actions/setup-node@v3
32+
uses: actions/setup-node@v4
3033
with:
3134
node-version: ${{ matrix.node-version }}
3235
cache: "npm"
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
#
2+
# Run unit tests.
3+
#
14
name: Test
25

36
on:
4-
- push
7+
workflow_call:
58

69
jobs:
710
run-tests:
@@ -24,7 +27,7 @@ jobs:
2427
submodules: recursive
2528

2629
- name: Set up Node.js ${{ matrix.node-version }}
27-
uses: actions/setup-node@v3
30+
uses: actions/setup-node@v4
2831
with:
2932
node-version: ${{ matrix.node-version }}
3033
cache: "npm"

.github/workflows/cron.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Crontab
2+
3+
on:
4+
schedule:
5+
- cron: '23 0 * * *'
6+
7+
jobs:
8+
test_regressions:
9+
uses: mindee/mindee-api-nodejs/.github/workflows/_test-regressions.yml@main
10+
secrets: inherit
11+
test_code_samples:
12+
uses: mindee/mindee-api-nodejs/.github/workflows/_test-code-samples.yml@main
13+
secrets: inherit

.github/workflows/linting.yml

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

.github/workflows/pull-request.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Pull Request
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
static_analysis:
8+
uses: mindee/mindee-api-nodejs/.github/workflows/_static-analysis.yml@main
9+
test_units:
10+
uses: mindee/mindee-api-nodejs/.github/workflows/_test-units.yml@main
11+
needs: static_analysis
12+
secrets: inherit
13+
test_integrations:
14+
uses: mindee/mindee-api-nodejs/.github/workflows/_test-integrations.yml@main
15+
needs: test_units
16+
secrets: inherit
17+
test_code_samples:
18+
uses: mindee/mindee-api-nodejs/.github/workflows/_test-code-samples.yml@main
19+
needs: test_units
20+
secrets: inherit

.github/workflows/push-main-branch.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,12 @@ on:
66
- main
77

88
jobs:
9+
static_analysis:
10+
uses: mindee/mindee-api-nodejs/.github/workflows/_static-analysis.yml@main
11+
test_units:
12+
uses: mindee/mindee-api-nodejs/.github/workflows/_test-units.yml@main
13+
needs: static_analysis
14+
secrets: inherit
915
tag:
1016
uses: mindee/client-lib-actions/.github/workflows/tag-version.yml@main
17+
needs: test_units

0 commit comments

Comments
 (0)