Skip to content

Commit 35e7c82

Browse files
authored
Merge pull request #433 from akv-platform/apply-reusable-workflows
Update action to use reusable workflows
2 parents 06db6c2 + 5bbbb02 commit 35e7c82

11 files changed

+43
-82
lines changed
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Basic validation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- releases/*
8+
paths-ignore:
9+
- '**.md'
10+
pull_request:
11+
paths-ignore:
12+
- '**.md'
13+
14+
jobs:
15+
call-basic-validation:
16+
name: Basic validation
17+
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main

.github/workflows/build.yml

-31
This file was deleted.

.github/workflows/check-dist.yml

+3-38
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# `dist/index.js` is a special file in Actions.
2-
# When you reference an action with `uses:` in a workflow,
3-
# `index.js` is the code that will run.
4-
# For our project, we generate this file through a build process from other source files.
5-
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
61
name: Check dist/
72

83
on:
@@ -17,36 +12,6 @@ on:
1712
workflow_dispatch:
1813

1914
jobs:
20-
check-dist:
21-
runs-on: ubuntu-latest
22-
23-
steps:
24-
- uses: actions/checkout@v3
25-
26-
- name: Set Node.js 16.x
27-
uses: actions/setup-node@v3
28-
with:
29-
node-version: 16.x
30-
cache: npm
31-
32-
- name: Install dependencies
33-
run: npm ci
34-
35-
- name: Rebuild the dist/ directory
36-
run: npm run build
37-
38-
- name: Compare the expected and actual dist/ directories
39-
run: |
40-
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
41-
echo "Detected uncommitted changes after build. See status below:"
42-
git diff
43-
exit 1
44-
fi
45-
id: diff
46-
47-
# If index.js was different than expected, upload the expected version as an artifact
48-
- uses: actions/upload-artifact@v3
49-
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
50-
with:
51-
name: dist
52-
path: dist/
15+
call-check-dist:
16+
name: Check dist/
17+
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main

.github/workflows/codeql-analysis.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: CodeQL analysis
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
schedule:
9+
- cron: '0 3 * * 0'
10+
11+
jobs:
12+
call-codeQL-analysis:
13+
name: CodeQL analysis
14+
uses: actions/reusable-workflows/.github/workflows/codeql-analysis.yml@main

.github/workflows/e2e-cache.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Validate cache
2+
23
on:
34
push:
45
branches:

.github/workflows/e2e-local-file.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Validate local file
2+
23
on:
34
push:
45
branches:

.github/workflows/e2e-publishing.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Validate publishing functionality
2+
23
on:
34
push:
45
branches:

.github/workflows/e2e-versions.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Validate Java e2e
2+
23
on:
34
push:
45
branches:

.github/workflows/licensed.yml

+3-13
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@ on:
1010
workflow_dispatch:
1111

1212
jobs:
13-
test:
14-
runs-on: ubuntu-latest
15-
name: Check licenses
16-
steps:
17-
- uses: actions/checkout@v3
18-
- run: npm ci
19-
- name: Install licensed
20-
run: |
21-
cd $RUNNER_TEMP
22-
curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/3.4.4/licensed-3.4.4-linux-x64.tar.gz
23-
sudo tar -xzf licensed.tar.gz
24-
sudo mv licensed /usr/local/bin/licensed
25-
- run: licensed status
13+
call-licensed:
14+
name: Licensed
15+
uses: actions/reusable-workflows/.github/workflows/licensed.yml@main

.github/workflows/release-new-action-version.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Release new action version
2+
23
on:
34
release:
45
types: [released]

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"build": "ncc build -o dist/setup src/setup-java.ts && ncc build -o dist/cleanup src/cleanup-java.ts",
99
"format": "prettier --write \"{,!(node_modules)/**/}*.ts\"",
1010
"format-check": "prettier --check \"{,!(node_modules)/**/}*.ts\"",
11+
"lint": "echo \"Fake command that does nothing. It is used in reusable workflows\"",
1112
"prerelease": "npm run-script build",
1213
"release": "git add -f dist/setup/index.js dist/cleanup/index.js",
1314
"test": "jest"

0 commit comments

Comments
 (0)