Skip to content

Commit f98be66

Browse files
committed
ci: restructure CI workflow to separate build and test jobs
1 parent d4a19ca commit f98be66

File tree

2 files changed

+55
-55
lines changed

2 files changed

+55
-55
lines changed

.github/workflows/ci.yml

Lines changed: 55 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ on:
1212
- main
1313

1414
jobs:
15-
test-and-build:
15+
build:
1616
runs-on: ubuntu-latest
17-
1817
steps:
1918
- uses: actions/checkout@v4
2019

@@ -29,10 +28,24 @@ jobs:
2928
- name: Install dependencies
3029
run: yarn install --immutable
3130

32-
- name: Setup environment
33-
run: |
34-
echo "NODE_ENV=test" >> $GITHUB_ENV
35-
# Add any other environment variables here
31+
- name: Build
32+
run: yarn build
33+
34+
test:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- run: corepack enable
40+
41+
- name: Set up Node.js
42+
uses: actions/setup-node@v4
43+
with:
44+
node-version: "20"
45+
cache: "yarn"
46+
47+
- name: Install dependencies
48+
run: yarn install --immutable
3649

3750
- name: Run tests with coverage
3851
run: yarn test:coverage:ci
@@ -42,18 +55,46 @@ jobs:
4255
BOARD_ID: ${{ secrets.BOARD_ID }}
4356
BREADBOARD_API_KEY: ${{ secrets.BREADBOARD_API_KEY }}
4457

45-
- name: Build
46-
run: yarn build
47-
4858
- name: Upload coverage reports
4959
uses: codecov/codecov-action@v5
5060
with:
5161
directory: ./coverage/
5262
fail_ci_if_error: false
5363

54-
- name: Upload build artifacts
55-
uses: actions/upload-artifact@v4
64+
release:
65+
needs:
66+
- test
67+
- build
68+
if: ${{ always() && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref }}
69+
runs-on: ubuntu-latest
70+
permissions:
71+
contents: write
72+
issues: write
73+
pull-requests: write
74+
packages: write
75+
steps:
76+
- uses: actions/checkout@v4
77+
with:
78+
fetch-depth: 0
79+
80+
- run: corepack enable
81+
82+
- name: Set up Node.js
83+
uses: actions/setup-node@v4
5684
with:
57-
name: dist
58-
path: dist/
59-
retention-days: 7
85+
node-version: "20"
86+
cache: "yarn"
87+
registry-url: "https://npm.pkg.github.com"
88+
scope: "@exadev"
89+
90+
- name: Install dependencies
91+
run: yarn install --immutable
92+
93+
- name: Build
94+
run: yarn build
95+
96+
- name: Release
97+
env:
98+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100+
run: npx semantic-release

.github/workflows/release.yml

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

0 commit comments

Comments
 (0)