generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 2
113 lines (111 loc) · 3.06 KB
/
test.yml
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
name: Check, Build, and Run
on:
pull_request:
types: ['opened', 'synchronize']
push:
branches:
- main
- 'releases/*'
env:
HUSKY_SKIP_INSTALL: '1'
jobs:
fmt:
name: Run code checks
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup node
uses: actions/[email protected]
with:
node-version-file: .node-version
cache: npm
- name: Install deps
run: npm ci
- name: Check formatting
run: npm run format-check
lint:
name: Run code checks
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup node
uses: actions/[email protected]
with:
node-version-file: .node-version
cache: npm
- name: Install deps
run: npm ci
- name: Lint
run: npm run lint
test:
name: Run code checks
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup node
uses: actions/[email protected]
with:
node-version-file: .node-version
cache: npm
- name: Install deps
run: npm ci
- name: Test
run: npm run test
build:
name: Build action
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup node
uses: actions/[email protected]
with:
node-version-file: .node-version
cache: npm
- name: Install deps
run: npm ci
- name: Build action
run: npm run build
- name: Verify no unstaged changes
run: .github/util/verify-no-unstaged-changes.sh
# TODO(cooper): Disabling these integration tests until we fix dependabot PR
# run-action:
# name: Run action
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repo
# uses: actions/[email protected]
# - name: Generate files to commit
# run: |
# echo "$(date): Testing ${GITHUB_SHA}" > test.txt
# echo "static value" > static.txt
# - name: Run action against test with default token
# uses: ./
# with:
# branch: test
# message: ':robot: Test commit'
# glob-patterns: test.txt
# - name: Run action against protected-test with admin token
# uses: ./
# with:
# token: ${{ secrets.QUIZLET_GIT_BOT_TOKEN }}
# branch: protected-test
# message: ':robot: Test commit'
# glob-patterns: test.txt
# - name: Run action against unchanged file
# id: unchanged-commit
# uses: ./
# with:
# branch: test
# message: ':robot: Test commit of static.txt'
# glob-patterns: static.txt
# - name: Fail if unchanged file was committed
# run: |
# if [[ -n "${{steps.unchanged-commit.outputs.sha}}" ]]
# then
# echo "::error::Action commited the unchanged file"
# exit 1
# fi