forked from mrdoob/three.js
-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (140 loc) · 4.75 KB
/
Copy pathci.yml
File metadata and controls
153 lines (140 loc) · 4.75 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: CI
on:
push:
branches:
- directive
pull_request:
paths-ignore:
- 'build/**'
- 'docs/**'
- 'files/**'
permissions:
contents: read
jobs:
test:
name: Lint, Unit, Unit addons, Circular dependencies & Examples testing
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Git checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 24.15.0
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: === Lint testing ===
run: npm run lint
- name: === Unit testing ===
run: npm run test-unit
- name: === Unit addons testing ===
run: npm run test-unit-addons
- name: === Examples ready for release ===
run: npm run test-e2e-cov
e2e:
name: E2E testing
if: false # Disabled: Puppeteer screenshot tests are slow and flaky in CI
runs-on: ${{ matrix.os }}
timeout-minutes: 30
permissions:
contents: read
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
CI: [ 0, 1, 2, 3, 4 ]
env:
CI: ${{ matrix.CI }}
steps:
- name: Git checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 24.15.0
cache: 'npm'
- name: Install Vulkan drivers and xvfb
run: |
sudo apt-get update
sudo apt-get install -y mesa-vulkan-drivers xvfb
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: === E2E testing ===
run: xvfb-run -a npm run test-e2e
- name: Upload output screenshots
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
if: always()
with:
name: Output screenshots-${{ matrix.os }}-${{ matrix.CI }}
path: test/e2e/output-screenshots
if-no-files-found: ignore
notify:
needs: [test, e2e]
runs-on: ubuntu-latest
if: always() && (needs.test.result == 'failure' || needs.e2e.result == 'failure')
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Notify Slack
run: |
PACKAGE_NAME=$(node -p "require('./package.json').name")
OVERALL_STATUS="❌ *$PACKAGE_NAME CI Failed!*"
COLOR="danger"
# Get commit info
COMMIT_MSG=$(git log -1 --pretty=%B | head -1)
COMMIT_AUTHOR=$(git log -1 --pretty=%an)
COMMIT_SHA=$(git rev-parse --short HEAD)
curl -X POST "${{ secrets.GENESYS_SLACK_WEBHOOK_URL }}" \
-H 'Content-Type: application/json' \
-d "{
\"attachments\": [
{
\"color\": \"$COLOR\",
\"title\": \"$OVERALL_STATUS\",
\"text\": \"$PACKAGE_NAME CI workflow failed\",
\"fields\": [
{
\"title\": \"Branch\",
\"value\": \"${{ github.ref_name }}\",
\"short\": true
},
{
\"title\": \"Test Job\",
\"value\": \"${{ needs.test.result }}\",
\"short\": true
},
{
\"title\": \"E2E Job\",
\"value\": \"${{ needs.e2e.result }}\",
\"short\": true
},
{
\"title\": \"Commit\",
\"value\": \"<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|$COMMIT_SHA: $COMMIT_MSG>\",
\"short\": false
},
{
\"title\": \"Author\",
\"value\": \"$COMMIT_AUTHOR\",
\"short\": true
}
],
\"footer\": \"GitHub Actions\",
\"footer_icon\": \"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\",
\"actions\": [
{
\"type\": \"button\",
\"text\": \"View Workflow\",
\"url\": \"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\"
}
]
}
]
}"