Skip to content

Commit 2ce5919

Browse files
authored
ci: clean up and simplify GitHub Actions (#228)
* ci: simplify skipping jobs on releases * ci: remove unused nx actions * ci: remove duplicated test job This was copied from `netlify/build`, where confusingly it had a job named `test` that tests all packages except the one named `build`, and `test-build` which tests only the one named `build`. This ended up copied over as two jobs that test all packages in this monorepo. * ci: remove unused go setup * ci: extract publint workflow and rename from "lint" to "publint" * ci: rename "Build" job to "Test"
1 parent dca313e commit 2ce5919

File tree

3 files changed

+78
-176
lines changed

3 files changed

+78
-176
lines changed

.github/workflows/build.yaml

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

.github/workflows/publint.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publint
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
types: [opened, synchronize, reopened]
7+
merge_group:
8+
jobs:
9+
publint:
10+
if: "${{ !startsWith(github.head_ref, 'release-') }}"
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 30
13+
steps:
14+
- run: git config --global core.symlinks true
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- name: Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: lts/*
22+
cache: 'npm'
23+
- name: Install dependencies
24+
run: npm ci
25+
- name: Build
26+
run: npm run build --workspaces=true
27+
- name: Publint
28+
run: npm run publint --workspaces=true --if-present

.github/workflows/test.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Test
2+
on:
3+
# Ensure GitHub actions are not run twice for same commits
4+
push:
5+
branches: [main]
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
merge_group:
9+
jobs:
10+
test:
11+
if: "${{ !startsWith(github.head_ref, 'release-') }}"
12+
runs-on: ${{ matrix.os }}
13+
timeout-minutes: 30
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, macOS-latest, windows-latest]
17+
node-version: ['*']
18+
deno-version: ['v1.37.0', 'v1.44.4']
19+
include:
20+
- os: ubuntu-latest
21+
node-version: '18.14.0'
22+
deno-version: 'v1.44.4'
23+
fail-fast: false
24+
steps:
25+
# Increasing the maximum number of open files. See:
26+
# https://github.com/actions/virtual-environments/issues/268
27+
- name: Increase open file limit
28+
run: sudo ulimit -Sn 65536
29+
if: "${{ matrix.os == 'macOS-latest' }}"
30+
- run: git config --global core.symlinks true
31+
- uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
- name: Node.js ${{ matrix.node-version }}
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: ${{ matrix.node-version }}
38+
cache: 'npm'
39+
- name: Setup Deno
40+
uses: denoland/setup-deno@v1
41+
with:
42+
deno-version: ${{ matrix.deno-version }}
43+
- name: Setup Deno dependencies
44+
run: deno cache https://deno.land/x/eszip@v0.55.2/eszip.ts
45+
- name: Install dependencies
46+
run: npm ci
47+
- name: Build
48+
run: npm run build --workspaces=true
49+
- name: Tests
50+
run: npm run test --workspaces=true

0 commit comments

Comments
 (0)