AT-based link agregator. Mirror of https://github.com/likeandscribe/frontpage
1name: PR
2on: pull_request
3
4permissions:
5 contents: read
6
7env:
8 # https://github.com/vercel/turborepo/issues/9320#issuecomment-2499219314
9 TURBO_SCM_BASE: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
10
11jobs:
12 formatting:
13 runs-on: ubuntu-latest
14 steps:
15 - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
16
17 - name: Install pnpm
18 uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
19
20 - name: Setup Node.js environment
21 uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
22 with:
23 node-version-file: .nvmrc
24 cache: "pnpm"
25
26 - run: pnpm i
27
28 - run: pnpm exec prettier --check .
29
30 test:
31 runs-on: ubuntu-latest
32 steps:
33 - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
34 with:
35 fetch-depth: 0
36 filter: "blob:none"
37
38 - name: Cache turbo build setup
39 uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0
40 with:
41 path: .turbo
42 key: ${{ runner.os }}-turbo-${{ github.sha }}
43 restore-keys: |
44 ${{ runner.os }}-turbo-
45
46 - name: Install pnpm
47 uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
48
49 - name: Setup Node.js environment
50 uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
51 with:
52 node-version-file: .nvmrc
53 cache: "pnpm"
54
55 - run: pnpm i
56 - run: pnpm exec turbo run --affected test
57
58 lint:
59 runs-on: ubuntu-latest
60 permissions:
61 # Need to add these 2 for eslint-annotate-action
62 pull-requests: read
63 checks: write
64 steps:
65 - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
66 with:
67 fetch-depth: 0
68 filter: "blob:none"
69
70 - name: Cache turbo build setup
71 uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0
72 with:
73 path: .turbo
74 key: ${{ runner.os }}-turbo-${{ github.sha }}
75 restore-keys: |
76 ${{ runner.os }}-turbo-
77
78 - name: Install pnpm
79 uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
80
81 - name: Setup Node.js environment
82 uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
83 with:
84 node-version-file: .nvmrc
85 cache: "pnpm"
86
87 - run: pnpm i
88 - run: pnpm exec turbo run --affected lint -- --output-file eslint_report.json --format json
89 continue-on-error: true
90
91 - name: Annotate Code Linting Results
92 uses: ataylorme/eslint-annotate-action@d57a1193d4c59cbfbf3f86c271f42612f9dbd9e9 # v3.0.0
93 with:
94 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95 report-json: "packages/**/eslint_report.json"
96
97 typecheck:
98 runs-on: ubuntu-latest
99 steps:
100 - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
101 with:
102 fetch-depth: 0
103 filter: "blob:none"
104
105 - name: Cache turbo build setup
106 uses: actions/cache@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0
107 with:
108 path: .turbo
109 key: ${{ runner.os }}-turbo-${{ github.sha }}
110 restore-keys: |
111 ${{ runner.os }}-turbo-
112
113 - name: Install pnpm
114 uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
115
116 - name: Setup Node.js environment
117 uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
118 with:
119 node-version-file: .nvmrc
120 cache: "pnpm"
121
122 - run: pnpm i
123 - run: pnpm exec turbo run --affected type-check