Skip to content

Commit 83a2a5b

Browse files
authored
Merge pull request #74 from DevilsDev/workflow/redesign-architecture
Workflow/redesign architecture
2 parents 6312d77 + b4f6129 commit 83a2a5b

32 files changed

+6451
-7717
lines changed

.github/workflows/backfill-releases.yml

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

.github/workflows/ci-meta.yml

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

.github/workflows/ci.yml

Lines changed: 48 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,93 @@
11
name: CI
2+
23
on:
3-
pull_request:
4-
types: [opened, synchronize, reopened, ready_for_review]
5-
paths:
6-
- "src/**"
7-
- "__tests__/**"
8-
- "package.json"
9-
- "package-lock.json"
10-
- ".github/workflows/**"
114
push:
12-
branches: [main, develop]
13-
paths:
14-
- "src/**"
15-
- "__tests__/**"
16-
- "package.json"
17-
- "package-lock.json"
18-
19-
permissions:
20-
contents: read
21-
22-
run-name: "CI — ${{ github.ref_name }} @ ${{ github.sha }}"
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
workflow_dispatch:
239

2410
concurrency:
2511
group: ${{ github.workflow }}-${{ github.ref }}
26-
cancel-in-progress: true
12+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
13+
14+
permissions:
15+
contents: read
16+
actions: read
2717

2818
env:
29-
NODE_VERSION: 20
19+
NODE_VERSION: "20"
20+
FORCE_COLOR: 1
21+
CI: true
3022

3123
jobs:
3224
test:
33-
if: github.event_name == 'push' || github.event.pull_request.draft == false
34-
timeout-minutes: 15
25+
name: Test & Lint
3526
runs-on: ubuntu-latest
27+
timeout-minutes: 15
28+
permissions:
29+
contents: read
3630
steps:
3731
- name: Harden runner
38-
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7
32+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
3933
with:
4034
egress-policy: audit
4135

4236
- name: Checkout code
43-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
37+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
4438
with:
4539
persist-credentials: false
4640
fetch-depth: 1
4741

48-
- name: 🟢 Setup Node.js
42+
- name: Setup Node.js
4943
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
5044
with:
5145
node-version: ${{ env.NODE_VERSION }}
5246
cache: npm
53-
registry-url: https://registry.npmjs.org/
5447
cache-dependency-path: package-lock.json
5548

56-
- name: Clear npm cache
57-
run: npm cache clean --force
58-
shell: bash
59-
6049
- name: Install dependencies
61-
run: |
62-
npm ci --no-optional --no-audit --prefer-offline
50+
run: npm ci --prefer-offline
6351
shell: bash
6452

65-
- name: 🧹 Lint
66-
run: npm run lint --if-present
67-
68-
- name: 🔍 Type check
69-
run: npm run typecheck --if-present
70-
71-
- name: ✅ Test
72-
run: npm test -- --ci --reporters=default --reporters=jest-junit --passWithNoTests
53+
- name: Lint
54+
run: npm run lint
55+
shell: bash
7356

74-
- name: Upload JUnit
75-
if: always()
76-
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
77-
with:
78-
name: junit
79-
path: junit.xml
57+
- name: Test
58+
run: npm test -- --ci --passWithNoTests --coverage
59+
shell: bash
8060

8161
- name: Upload coverage
8262
if: always()
83-
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
63+
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
8464
with:
85-
name: coverage
86-
path: coverage
65+
token: ${{ secrets.CODECOV_TOKEN }}
66+
fail_ci_if_error: false
67+
continue-on-error: true
8768

88-
coverage:
89-
needs: test
90-
if: always() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
91-
timeout-minutes: 5
69+
build:
70+
name: Build Check
9271
runs-on: ubuntu-latest
93-
permissions:
94-
contents: read
72+
timeout-minutes: 10
73+
needs: test
9574
steps:
9675
- name: Harden runner
97-
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7
76+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
9877
with:
9978
egress-policy: audit
10079

101-
- name: Download coverage
102-
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
103-
with:
104-
name: coverage
105-
path: coverage
106-
continue-on-error: true
80+
- name: Checkout code
81+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
10782

108-
- name: Upload to Codecov
109-
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
83+
- name: Setup Node.js
84+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
11085
with:
111-
token: ${{ secrets.CODECOV_TOKEN }}
112-
fail_ci_if_error: false
86+
node-version: ${{ env.NODE_VERSION }}
87+
cache: npm
88+
89+
- name: Install dependencies
90+
run: npm ci --prefer-offline
91+
92+
- name: Build
93+
run: npm run build --if-present

0 commit comments

Comments
 (0)