-
Notifications
You must be signed in to change notification settings - Fork 406
130 lines (117 loc) · 4.73 KB
/
Copy pathproject.yml
File metadata and controls
130 lines (117 loc) · 4.73 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
name: Project
on:
pull_request:
push:
branches: [master]
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- uses: ./.github/actions/node/latest
# NOTE: Ok this next bit seems unnecessary, right? The problem is that
# this repo is currently incompatible with npm, at least with the
# devDependencies. While this is intended to be corrected, it hasn't yet,
# so the easiest thing to do here is just use a fresh package.json. This
# is needed because actionlint runs an `npm install` at the beginning.
- name: Clear package.json
run: |
rm package.json
npm init -y
- name: actionlint
id: actionlint
uses: raven-actions/actionlint@3a24062651993d40fed1019b58ac6fbdfbf276cc # v2.0.1
with:
matcher: true
fail-on-error: true
shellcheck: false # TODO should we enable this?
- name: actionlint Summary
if: ${{ steps.actionlint.outputs.exit-code != 0 }}
run: |
echo "Used actionlint version ${{ steps.actionlint.outputs.version-semver }}"
echo "Used actionlint release ${{ steps.actionlint.outputs.version-tag }}"
echo "actionlint ended with ${{ steps.actionlint.outputs.exit-code }} exit code"
echo "actionlint ended because '${{ steps.actionlint.outputs.exit-message }}'"
echo "actionlint found ${{ steps.actionlint.outputs.total-errors }} errors"
echo "actionlint checked ${{ steps.actionlint.outputs.total-files }} files"
echo "actionlint cache used: ${{ steps.actionlint.outputs.cache-hit }}"
exit ${{ steps.actionlint.outputs.exit-code }}
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- uses: ./.github/actions/node/latest
- uses: ./.github/actions/install
- run: npm run lint
package-size-report:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- uses: ./.github/actions/node/latest
- run: FILENAME=$(npm pack) && tar -zxf $FILENAME -C package
- run: yarn --prod --ignore-optional
working-directory: ./package
- name: Compute module size tree and report
uses: qard/heaviest-objects-in-the-universe@e2af4ff3a88e5fe507bd2de1943b015ba2ddda66 # v1.0.0
working-directory: ./package
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
static-analysis:
runs-on: ubuntu-latest
name: Datadog Static Analyzer
if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: Check code meets quality and security standards
id: datadog-static-analysis
uses: DataDog/datadog-static-analyzer-github-action@2cc0e0621ea2863272b29d9aea230d9aad238086 # v2.0.0
with:
dd_api_key: ${{ secrets.DD_API_KEY }}
dd_app_key: ${{ secrets.DD_APP_KEY }}
dd_site: datadoghq.com
cpu_count: 2
typescript:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- uses: ./.github/actions/node/latest
- uses: ./.github/actions/install
- run: npm run type:test
- run: npm run type:doc
# TODO: Remove need for `npm show` before re-enabling to avoid rate limit errors.
# verify-yaml:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
# - uses: ./.github/actions/node/latest
# - uses: ./.github/actions/install
# - run: node scripts/verify-ci-config.js
yarn-dedupe:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: read
steps:
- name: Checkout code
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Setup Node.js
uses: ./.github/actions/node/latest
- name: Install dependencies
uses: ./.github/actions/install
- name: Run yarn dependencies:dedupe
run: yarn dependencies:dedupe
- name: Run yarn dedupe check
run: ./.github/scripts/yarn-dedupe.sh
env:
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
PR_USER_TYPE: ${{ github.event.pull_request.user.type }}
GITHUB_EVENT_NAME: ${{ github.event_name }}