|
8 | 8 | paths-ignore: |
9 | 9 | - docs/** |
10 | 10 | - '*.md' |
| 11 | + |
11 | 12 | jobs: |
12 | | - browsers: |
| 13 | + dependency-review: |
| 14 | + name: Dependency Review |
| 15 | + if: github.event_name == 'pull_request' |
13 | 16 | runs-on: ubuntu-latest |
| 17 | + permissions: |
| 18 | + contents: read |
14 | 19 | steps: |
15 | | - - uses: actions/checkout@v3 |
16 | | - - uses: actions/setup-node@v3 |
17 | | - - name: Install Dependencies |
18 | | - run: npm install |
19 | | - - name: Test |
20 | | - run: npm run test:browser |
| 20 | + - name: Check out repo |
| 21 | + uses: actions/checkout@v3 |
| 22 | + with: |
| 23 | + persist-credentials: false |
| 24 | + |
| 25 | + - name: Dependency review |
| 26 | + uses: actions/dependency-review-action@v2 |
21 | 27 |
|
22 | 28 | lint: |
| 29 | + name: Lint Code |
23 | 30 | runs-on: ubuntu-latest |
| 31 | + permissions: |
| 32 | + contents: read |
24 | 33 | steps: |
25 | | - - uses: actions/checkout@v3 |
26 | | - - uses: actions/setup-node@v3 |
| 34 | + - name: Check out repo |
| 35 | + uses: actions/checkout@v3 |
| 36 | + with: |
| 37 | + persist-credentials: false |
| 38 | + |
| 39 | + - name: Setup Node |
| 40 | + uses: actions/setup-node@v3 |
27 | 41 | with: |
28 | | - node-version: 18 |
29 | | - - name: Install Dependencies |
30 | | - run: npm install --ignore-scripts |
31 | | - - name: Lint |
| 42 | + node-version: lts/* |
| 43 | + |
| 44 | + - name: Install dependencies |
| 45 | + run: npm i --ignore-scripts |
| 46 | + |
| 47 | + - name: Lint code |
32 | 48 | run: npm run lint |
33 | 49 |
|
| 50 | + browsers: |
| 51 | + name: Test Browsers |
| 52 | + runs-on: ubuntu-latest |
| 53 | + permissions: |
| 54 | + contents: read |
| 55 | + steps: |
| 56 | + - name: Check out repo |
| 57 | + uses: actions/checkout@v3 |
| 58 | + with: |
| 59 | + persist-credentials: false |
| 60 | + |
| 61 | + - name: Setup Node |
| 62 | + uses: actions/setup-node@v3 |
| 63 | + with: |
| 64 | + node-version: lts/* |
| 65 | + |
| 66 | + - name: Install dependencies |
| 67 | + run: npm i |
| 68 | + |
| 69 | + - name: Run tests |
| 70 | + run: npm run test:browser |
| 71 | + |
34 | 72 | test: |
| 73 | + name: Test |
35 | 74 | runs-on: ubuntu-latest |
| 75 | + permissions: |
| 76 | + contents: read |
36 | 77 | strategy: |
37 | 78 | matrix: |
38 | | - node-version: |
39 | | - - 6 |
40 | | - - 8 |
41 | | - - 10 |
42 | | - - 11 |
43 | | - - 12 |
44 | | - - 13 |
45 | | - - 14 |
46 | | - - 15 |
47 | | - - 16 |
48 | | - - 18 |
| 79 | + node-version: [6, 8, 10, 11, 12, 13, 14, 15, 16, 18] |
49 | 80 | steps: |
50 | | - - uses: actions/checkout@v3 |
51 | | - - name: Use Node.js ${{ matrix.node-version }} |
| 81 | + - name: Check out repo |
| 82 | + uses: actions/checkout@v3 |
| 83 | + with: |
| 84 | + persist-credentials: false |
| 85 | + |
| 86 | + - name: Setup Node ${{ matrix.node-version }} |
52 | 87 | uses: actions/setup-node@v3 |
53 | 88 | with: |
54 | 89 | node-version: ${{ matrix.node-version }} |
| 90 | + |
55 | 91 | - name: Upgrade npm |
56 | 92 | if: ${{ success() && matrix.node-version == '6' }} |
57 | 93 | run: npm i npm@6.13.4 -g |
58 | | - - name: Install Dependencies |
59 | | - run: npm install --ignore-scripts |
60 | | - - name: Test |
| 94 | + |
| 95 | + - name: Install dependencies |
| 96 | + run: npm i --ignore-scripts |
| 97 | + |
| 98 | + - name: Run tests |
61 | 99 | run: npm run test:unit |
62 | 100 |
|
63 | 101 | typescript: |
| 102 | + name: Test TypeScript |
64 | 103 | runs-on: ubuntu-latest |
| 104 | + permissions: |
| 105 | + contents: read |
65 | 106 | steps: |
66 | | - - uses: actions/checkout@v3 |
67 | | - - uses: actions/setup-node@v3 |
| 107 | + - name: Check out repo |
| 108 | + uses: actions/checkout@v3 |
| 109 | + with: |
| 110 | + persist-credentials: false |
| 111 | + |
| 112 | + - name: Setup Node |
| 113 | + uses: actions/setup-node@v3 |
68 | 114 | with: |
69 | | - node-version: 18 |
70 | | - - name: Install Dependencies |
71 | | - run: npm install --ignore-scripts |
| 115 | + node-version: lts/* |
| 116 | + |
| 117 | + - name: Install dependencies |
| 118 | + run: npm i --ignore-scripts |
| 119 | + |
72 | 120 | - name: tsd |
73 | 121 | run: npm run test:typescript |
74 | 122 |
|
75 | 123 | automerge: |
76 | | - needs: |
77 | | - - lint |
78 | | - - browsers |
79 | | - - test |
80 | | - - typescript |
81 | | - runs-on: ubuntu-latest |
| 124 | + name: Automerge Dependabot PRs |
| 125 | + if: > |
| 126 | + github.event_name == 'pull_request' && |
| 127 | + github.event.pull_request.user.login == 'dependabot[bot]' |
| 128 | + needs: [browsers, lint, test, typescript] |
82 | 129 | permissions: |
83 | 130 | pull-requests: write |
84 | 131 | contents: write |
| 132 | + runs-on: ubuntu-latest |
85 | 133 | steps: |
86 | 134 | - uses: fastify/github-action-merge-dependabot@v3 |
87 | 135 | with: |
88 | 136 | github-token: ${{ secrets.GITHUB_TOKEN }} |
| 137 | + target: major |
0 commit comments