Skip to content

Commit 5fefe8c

Browse files
committed
ci: split PR checks into granular workflows
Add workflows: format, typecheck, build, test, changeset. Remove reproducible-build workflow. Run steps inside container via scripts/repro/exec.sh.
1 parent c5d7e74 commit 5fefe8c

File tree

5 files changed

+125
-41
lines changed

5 files changed

+125
-41
lines changed
Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
name: Reproducible Build
1+
name: CI - Build
22

33
on:
44
workflow_dispatch:
55
pull_request:
6+
types: [opened, edited, synchronize]
67
branches: [main]
78

89
jobs:
9-
reproducible:
10+
build:
1011
runs-on: ubuntu-latest
1112
permissions:
1213
contents: read
@@ -30,14 +31,8 @@ jobs:
3031
restore-keys: |
3132
${{ runner.os }}-pnpm-store-
3233
33-
- name: Run hermetic build
34-
env:
35-
GIT_COMMIT: ${{ github.sha }}
36-
run: |
37-
REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" pnpm build:canonical
34+
- name: Install deps (container)
35+
run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm install --frozen-lockfile
3836

39-
- name: Upload canonical artifact and checksums
40-
uses: actions/upload-artifact@v4
41-
with:
42-
name: reproducible-artifacts-${{ github.sha }}
43-
path: out/*
37+
- name: Build (container)
38+
run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm turbo build --force
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,22 @@
1-
name: Check PR
1+
name: CI - Changeset
22

33
on:
44
workflow_dispatch:
55
pull_request:
6-
types:
7-
- opened
8-
- edited
9-
- synchronize
10-
branches:
11-
- main
6+
types: [opened, edited, synchronize]
7+
branches: [main]
128

139
jobs:
14-
check:
10+
changeset:
1511
runs-on: ubuntu-latest
1612
permissions:
1713
contents: read
1814
steps:
1915
- name: Checkout
2016
uses: actions/checkout@v4
2117
with:
22-
ref: ${{github.event.pull_request.head.sha}}
2318
fetch-depth: 0
2419

25-
- name: Check for [skip i18n]
26-
run: |
27-
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
28-
if echo "$COMMIT_MESSAGE" | grep -iq '\[skip i18n\]'; then
29-
echo "Skipping i18n checks due to [skip i18n] in commit message."
30-
exit 0
31-
fi
32-
3320
- name: Build hermetic image
3421
run: docker build -f Dockerfile.repro -t lingo-repro:20.12.2 .
3522

@@ -50,18 +37,6 @@ jobs:
5037
- name: Install deps (container)
5138
run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm install --frozen-lockfile
5239

53-
- name: Disable turbo telemetry (container)
54-
run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm turbo telemetry disable
55-
56-
- name: Check formatting (container)
57-
run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm prettier . --check
58-
59-
- name: Build (container)
60-
run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm turbo build --force
61-
62-
- name: Test (container)
63-
run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm turbo test
64-
6540
- name: Require changeset to be present in PR (container)
6641
if: github.event.pull_request.user.login != 'dependabot[bot]'
6742
run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm changeset status --since origin/main

.github/workflows/ci-format.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI - Format
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types: [opened, edited, synchronize]
7+
branches: [main]
8+
9+
jobs:
10+
format:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Build hermetic image
21+
run: docker build -f Dockerfile.repro -t lingo-repro:20.12.2 .
22+
23+
- name: Prepare pnpm store path
24+
run: echo "REPRO_PNPM_STORE=${{ runner.temp }}/pnpm-store" >> $GITHUB_ENV
25+
26+
- name: Cache pnpm store
27+
uses: actions/cache@v3
28+
with:
29+
path: ${{ env.REPRO_PNPM_STORE }}
30+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
31+
restore-keys: |
32+
${{ runner.os }}-pnpm-store-
33+
34+
- name: Install deps (container)
35+
run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm install --frozen-lockfile
36+
37+
- name: Check formatting (container)
38+
run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm prettier . --check

.github/workflows/ci-test.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI - Test
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types: [opened, edited, synchronize]
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Build hermetic image
21+
run: docker build -f Dockerfile.repro -t lingo-repro:20.12.2 .
22+
23+
- name: Prepare pnpm store path
24+
run: echo "REPRO_PNPM_STORE=${{ runner.temp }}/pnpm-store" >> $GITHUB_ENV
25+
26+
- name: Cache pnpm store
27+
uses: actions/cache@v3
28+
with:
29+
path: ${{ env.REPRO_PNPM_STORE }}
30+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
31+
restore-keys: |
32+
${{ runner.os }}-pnpm-store-
33+
34+
- name: Install deps (container)
35+
run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm install --frozen-lockfile
36+
37+
- name: Test (container)
38+
run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm turbo test

.github/workflows/ci-typecheck.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI - Typecheck
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types: [opened, edited, synchronize]
7+
branches: [main]
8+
9+
jobs:
10+
typecheck:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Build hermetic image
21+
run: docker build -f Dockerfile.repro -t lingo-repro:20.12.2 .
22+
23+
- name: Prepare pnpm store path
24+
run: echo "REPRO_PNPM_STORE=${{ runner.temp }}/pnpm-store" >> $GITHUB_ENV
25+
26+
- name: Cache pnpm store
27+
uses: actions/cache@v3
28+
with:
29+
path: ${{ env.REPRO_PNPM_STORE }}
30+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
31+
restore-keys: |
32+
${{ runner.os }}-pnpm-store-
33+
34+
- name: Install deps (container)
35+
run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm install --frozen-lockfile
36+
37+
- name: Typecheck (container)
38+
run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm turbo typecheck

0 commit comments

Comments
 (0)