-
Notifications
You must be signed in to change notification settings - Fork 3.4k
64 lines (60 loc) · 2.13 KB
/
Copy pathci.yml
File metadata and controls
64 lines (60 loc) · 2.13 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
# Github actions workflow name
name: CI
# Triggers the workflow on push or pull request events
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test:
name: 'Tests on ${{matrix.os}} with Node "${{matrix.node}}"'
strategy:
fail-fast: false
matrix:
# Test all mainstream operating systems
os: [ubuntu-latest, macos-latest, windows-latest]
node: ['current']
include:
- os: ubuntu-latest
node: 'lts/*'
- os: ubuntu-latest
node: 'lts/-1'
- os: ubuntu-latest
node: 'lts/-2'
- os: ubuntu-latest
node: 'lts/-3'
runs-on: ${{ matrix.os }}
# This has copy/paste steps and should be refactored using DRY
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts
- name: Print put node & npm version
run: node --version && pnpm --version
- name: Run node tests (ESM + CJS)
run: pnpm run test:node
copilot-review:
name: Request Copilot review
runs-on: ubuntu-latest
continue-on-error: true
if: github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened')
permissions:
pull-requests: write
steps:
- name: Request Copilot review
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers \
-f "reviewers[]=copilot-pull-request-reviewer" \
|| echo "::warning::Could not request Copilot review (the token may lack pull-requests: write access, or Copilot PR reviews may not be enabled for this repository)"