-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (51 loc) · 2.09 KB
/
ci.yml
File metadata and controls
55 lines (51 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: CI
on:
push:
branches:
# Runs on merge to main only
- main
pull_request:
# Needed for nx-set-shas when run on the main branch
permissions:
actions: read
contents: read
jobs:
main:
runs-on: ubuntu-latest
# Pushes to `main` get the read-write Nx Cloud token so the remote
# cache is populated; everything else (PRs, other branches) gets the
# read-only token, which is safe to expose. Both tokens live as
# repository secrets — we intentionally avoid GitHub Environments
# here because they register every run as a "deployment" in the UI.
env:
NX_CLOUD_ACCESS_TOKEN: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') && secrets.NX_CLOUD_ACCESS_TOKEN_RW || secrets.NX_CLOUD_ACCESS_TOKEN_RO }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
# For pull_request events, check out the PR head (not GitHub's auto-created
# merge commit). This prevents 3-way merge from re-introducing deps that
# the PR is supposed to remove. nrwl/nx-set-shas still computes the correct
# affected range from git history. Falls back to github.sha for push events.
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: actions/setup-node@v6
with:
node-version: 24
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.2.9
# This line enables distribution
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested
# - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci"
- run: bun install
- uses: nrwl/nx-set-shas@v4
- name: Test tool-call hook scripts
run: bash .github/hooks/scripts/test-hooks.sh
shell: bash
- name: Print Environment Info
run: npx nx report
shell: bash
- run: npx nx format:check
- run: npx nx affected -t lint test build e2e-ci --verbose=false --parallel=3
- run: npx nx-cloud fix-ci
if: always()