This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
generated from kachick/action-typescript-template
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (69 loc) · 2.01 KB
/
ci.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
name: CI
on:
push:
branches: [main]
paths-ignore:
- '.github/dependabot.yml'
- 'LICENSE'
- '.editorconfig'
- '.eslintrc.js'
- 'README.md'
- '.vscode/**'
pull_request:
paths-ignore:
- '.github/dependabot.yml'
- 'LICENSE'
- '.editorconfig'
- '.eslintrc.js'
- 'README.md'
- '.vscode/**'
jobs:
test:
# To update git diff
permissions:
pull-requests: write
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true # Fetch example project
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
# https://yoshiori.hatenablog.com/entry/2021/12/08/220839
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Test (Need to build before test)
run: npm test
- name: Ensure we can make package
run: npm run package
# dependabot E-mail address: https://github.com/orgs/community/discussions/26560
- name: Update build files
run: |
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git config user.name 'github-actions[bot]'
git add dist
if ! git diff --exit-code --quiet
then
git commit -m 'Update build files'
git push
fi
if: ${{ github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]' }}
- name: Prevent missing commits after compile
run: git add --intent-to-add . && git diff --exit-code
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Lint
run: npm run lint:check