Skip to content

Commit 6a2458f

Browse files
author
Antti Harju
authored
Migrate CI away from erb actions (#786)
1 parent edac78e commit 6a2458f

11 files changed

Lines changed: 122 additions & 297 deletions

.github/templates/jobs/build.erb

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

.github/templates/jobs/test.erb

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

.github/templates/pull_request.yml.erb

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

.github/templates/release.yml.erb

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

.github/workflows/build.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Build
2+
3+
on: workflow_call
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-22.04
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Set Node.js 20.x
11+
uses: actions/setup-node@v4
12+
with:
13+
node-version: 20.x
14+
- name: 'Install'
15+
run: |
16+
npm install
17+
- name: 'Prettier'
18+
run: |
19+
npm run format-check
20+
- name: 'Lint'
21+
run: |
22+
npm run lint
23+
- name: 'Test'
24+
run: |
25+
npm run test
26+
- name: 'build'
27+
run: |
28+
npm run build
29+
npm run package
30+
31+
test:
32+
runs-on: ubuntu-22.04
33+
steps:
34+
- uses: actions/checkout@v4
35+
- name: Set Node.js 20.x
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: 20.x
39+
- name: 'Build action for test'
40+
run: |
41+
npm install
42+
npm run all
43+
git clean -fXd
44+
- name: Test executing the action
45+
uses: ./
46+
with:
47+
composeFile: docker-compose.ci.yml
48+
serviceName: test
49+
composeCommand: run
50+
composeArguments: ''
51+
runCommand: ls
52+
build: 'true'
53+
push: 'false'
54+
build-args: |
55+
MY_TEST_ARG=some-value
56+
OTHER_ARG=2
57+
58+
release:
59+
runs-on: ubuntu-22.04
60+
name: 'Build and release action'
61+
needs: [build, test]
62+
steps:
63+
- uses: actions/checkout@v4
64+
with:
65+
fetch-depth: 0
66+
persist-credentials: true
67+
- name: Configure git
68+
uses: smartlyio/github-actions@git-init-userinfo-v1
69+
- name: Release flow
70+
uses: smartlyio/github-actions@release-action-node-v1
71+
with:
72+
token: '${{ secrets.GITHUB_TOKEN }}'
73+
dry_run: ${{ github.event_name == 'pull_request' }}
74+
use_yarn: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}

.github/workflows/check_release_label.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@ name: Check Labels
33
on:
44
pull_request:
55
branches:
6-
- master
6+
- master
77
types:
8-
- opened
9-
- labeled
10-
- unlabeled
11-
- synchronize
8+
- opened
9+
- labeled
10+
- unlabeled
11+
- synchronize
1212

1313
jobs:
1414
check_labels:
1515
runs-on: ubuntu-22.04
1616
steps:
17-
- uses: smartlyio/check-versioning-action@v5
18-
with:
19-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20-
17+
- uses: smartlyio/check-versioning-action@v5
18+
with:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pull_request.generated.yml

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

.github/workflows/pull_request.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Pull Request
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
7+
jobs:
8+
build:
9+
name: Build
10+
uses: ./.github/workflows/build.yml

.github/workflows/release.generated.yml

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

0 commit comments

Comments
 (0)