forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (63 loc) · 2.3 KB
/
CI.yml
File metadata and controls
78 lines (63 loc) · 2.3 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
name: CI
on: pull_request
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
if: github.repository == 'DefinitelyTyped/DefinitelyTyped'
steps:
- uses: actions/checkout@v4
with:
# Need this to be able to inquire about origin/master
filter: blob:none # https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/
fetch-depth: 0 # Default is 1; need to set to 0 to get the benefits of blob:none.
- uses: actions/setup-node@v4
with:
node-version: '16'
# forbid symlinks
- name: 'Pre-run validation'
run: |
symlinks="$(find . -type l)"
if [[ -n "$symlinks" ]]; then
printf "Aborting: symlinks found:\n%s" "$symlinks"; exit 1
fi
- uses: pnpm/action-setup@v2
- name: Get pnpm cache info
id: pnpm-cache
run: |
echo "store=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Restore pnpm cache
uses: actions/cache/restore@v3
with:
path: ${{ steps.pnpm-cache.outputs.store }}
key: ${{ runner.os }}-pnpm-store-cache-
restore-keys: ${{ runner.os }}-pnpm-store-cache-
- run: ./scripts/pnpm-install.sh
name: pnpm install
# Run tests
- run: pnpm run test-all
- name: 'Run Danger'
env:
# See https://github.com/danger/danger-js/issues/1042
DANGER_GITHUB_API_BASE_URL: 'https://api.github.com'
# Danger failing (for example through rate-limiting) shouldn't fail the build
run: |
# Exposing this token is safe because the user of it has no other public repositories
# and has no permission to modify this repository. See #62638 for the discussion.
TOKEN='ghp_i5wtj1l2AbpFv3OU96w6R'
TOKEN+='On3bHOkcV2AmVY6'
DANGER_GITHUB_API_TOKEN=$TOKEN pnpm danger ci || $( exit 0 )
scripts:
runs-on: ubuntu-latest
if: github.repository == 'DefinitelyTyped/DefinitelyTyped'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16'
- uses: pnpm/action-setup@v2
with:
run_install: |
- args: [--filter, ., --filter, '{./scripts}...']
- run: pnpm tsc -p ./scripts