-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (71 loc) · 2.02 KB
/
ci.yml
File metadata and controls
85 lines (71 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
80
81
82
83
84
85
name: Continuous Integration
on:
push:
branches:
- 'master'
- 'experiments/**/*'
- '_integration/**/*'
tags:
- '*'
pull_request:
branches:
- '*'
permissions:
actions: read
contents: write
id-token: write
security-events: write
jobs:
test-typescript:
name: TypeScript Tests
runs-on: small-al2023
steps:
- name: Setup Credentials
uses: Workiva/gha-setup-credentials@v2.1.9
- name: Checkout
id: checkout
uses: actions/checkout@v6
with:
ref: ${{ github.head_ref || github.ref }}
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v6
with:
node-version-file: .node-version
cache: npm
- name: Install Dependencies
id: npm-ci
run: npm ci
- name: Run all package scripts
run: npm run all
- name: Compare the expected and actual dist/ directories
id: diff
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build."
echo "changes_detected=true" >> "$GITHUB_OUTPUT"
else
echo "No changes detected in dist/ directory.";
echo "changes_detected=false" >> "$GITHUB_OUTPUT"
fi
- name: Commit and push dist/ changes
if:
github.event_name == 'pull_request' &&
steps.diff.outputs.changes_detected == 'true'
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
git add -A
git commit -m "chore: update dist/ directory [automated]"
git push
- uses: Workiva/gha-upload-test-reports@v2.0.38
test-action:
name: GitHub Actions Test
runs-on: small-al2023
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v6
- name: Test Local Action
id: test-action
uses: ./