-
Notifications
You must be signed in to change notification settings - Fork 1
107 lines (106 loc) · 3.45 KB
/
Copy pathtests.yml
File metadata and controls
107 lines (106 loc) · 3.45 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: tests
on:
pull_request:
push:
branches:
- "**"
tags:
- "!**"
workflow_call:
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/checkout@v4
- run: npm ci
- run: npm run build
- run: npm run format-check
- run: npm run lint
- name: Verify no unstaged changes
shell: bash
run: |
if [[ "$(git status --porcelain)" != "" ]]; then
echo ----------------------------------------
echo git status
echo ----------------------------------------
git status
echo ----------------------------------------
echo git diff
echo ----------------------------------------
git diff
echo ----------------------------------------
echo Troubleshooting
echo ----------------------------------------
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && npm ci && npm run format && npm run build"
exit 1
fi
testing:
strategy:
matrix:
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, macos-14, macos-13]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test main versus main
uses: ./.github/actions/testing
with:
base-ref: "main"
head-ref: "main"
ancestor-ref: "6eb785672d2c6770af9e985d36ddcd1b3a285f8e"
- name: Test the non-fetched remote branch versus itself
uses: ./.github/actions/testing
with:
base-ref: "test-0001-base-ref"
head-ref: "test-0001-base-ref"
ancestor-ref: "184170635f898a6d9ec476a9ea9f0f7fdefb4f64"
- name: Test head-ref fallback
uses: ./.github/actions/testing
with:
head-ref: ""
base-ref: "test-0001-base-ref"
fallback-head-ref: "test-0001-head-ref"
ancestor-ref: "6eb785672d2c6770af9e985d36ddcd1b3a285f8e"
- name: Test base-ref fallback to defaults to main
uses: ./.github/actions/testing
with:
head-ref: "test-0001-head-ref"
base-ref: ""
ancestor-ref: "6eb785672d2c6770af9e985d36ddcd1b3a285f8e"
- name: Test `fail-after` is not triggered (branches)
uses: ./.github/actions/testing
with:
head-ref: "test-0001-base-ref"
base-ref: "test-0001-head-ref"
deepen-length: 1
fail-after: 3
ancestor-ref: "6eb785672d2c6770af9e985d36ddcd1b3a285f8e"
- name: Test `fail-after` is not triggered (sha1)
uses: ./.github/actions/testing
with:
head-ref: "184170635f898a6d9ec476a9ea9f0f7fdefb4f64"
base-ref: "e649b76f3085b2364ab2a834e43ae6fd74a33fa9"
deepen-length: 1
fail-after: 3
ancestor-ref: "6eb785672d2c6770af9e985d36ddcd1b3a285f8e"
- name: Test `fail-after` is triggered
id: test_fail-after
uses: ./.github/actions/testing
with:
head-ref: "test-0001-base-ref"
base-ref: "test-0001-head-ref"
deepen-length: 1
fail-after: 2
ancestor-ref: ""
- name: Test `fallback-fetch-all`
uses: ./.github/actions/testing
with:
head-ref: "test-0001-base-ref"
base-ref: "test-0001-head-ref"
deepen-length: 1
fail-after: 2
fallback-fetch-all: true
ancestor-ref: "6eb785672d2c6770af9e985d36ddcd1b3a285f8e"