generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 13
79 lines (72 loc) · 2.02 KB
/
build.yml
File metadata and controls
79 lines (72 loc) · 2.02 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Build
on:
push:
branches: ["main", "v1.x"]
pull_request:
branches: ["main", "v1.x"]
permissions:
contents: read # This is required for actions/checkout
# Cancel when pull request is updated
concurrency:
group: ${{ github.head_ref || github.ref_name || github.run_id }}
cancel-in-progress: true
jobs:
lint-commits:
# Note: To re-run `lint-commits` after fixing the PR title, close-and-reopen the PR.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: "npm"
- name: Check PR title
run: |
node "$GITHUB_WORKSPACE/.github/workflows/lintcommit.js"
build:
needs: lint-commits
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: built-artifacts
path: |
packages/**/dist*/*
package.json
package-lock.json
unit-tests:
needs: build
strategy:
fail-fast: false
matrix:
node-version: ["22.x", "24.x"]
uses: "./.github/workflows/unit-tests.yml"
with:
node-version: ${{ matrix.node-version }}
integration-tests:
needs: build
# Skip integration tests for PRs from forked repos (no access to secrets)
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request'
permissions:
contents: read
id-token: write
strategy:
fail-fast: false
matrix:
node-version: ["22.x", "24.x"]
uses: "./.github/workflows/integration-tests.yml"
with:
node-version: ${{ matrix.node-version }}
secrets: inherit