|
1 | | -name: Continuous Integration |
| 1 | +name: CI |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
|
7 | 7 | pull_request: |
8 | 8 | branches: |
9 | 9 | - master |
| 10 | + schedule: |
| 11 | + - cron: '0 2 * * 1' # At 02:00 on Monday |
| 12 | + |
| 13 | +permissions: {} |
10 | 14 |
|
11 | 15 | jobs: |
12 | | - build: |
13 | | - runs-on: ubuntu-latest |
| 16 | + test: |
| 17 | + name: Test |
| 18 | + runs-on: ${{ matrix.os }} |
| 19 | + timeout-minutes: 15 |
14 | 20 | strategy: |
15 | 21 | matrix: |
16 | | - node-version: [10, 12, 14] |
| 22 | + os: [ubuntu-latest] |
| 23 | + node-version: [10, 12, 14, 16] |
| 24 | + include: |
| 25 | + - os: macos-latest |
| 26 | + node_version: 14 |
| 27 | + - os: windows-latest |
| 28 | + node_version: 14 |
| 29 | + fail-fast: false |
| 30 | + steps: |
| 31 | + - uses: actions/checkout@v2 |
| 32 | + - name: Use Node.js ${{ matrix.node-version }} |
| 33 | + uses: actions/setup-node@v1 |
| 34 | + with: |
| 35 | + node-version: ${{ matrix.node-version }} |
| 36 | + - name: Update NPM |
| 37 | + if: matrix.os != 'macos-latest' |
| 38 | + run: npm install --global npm |
| 39 | + - name: Update NPM (macOS) |
| 40 | + if: matrix.os == 'macos-latest' |
| 41 | + run: npm install --global --force npm |
| 42 | + - name: Bootstrap project |
| 43 | + run: npm ci --ignore-scripts |
| 44 | + - name: Run tests |
| 45 | + run: npm test --ignore-scripts |
| 46 | + - name: Publish coverage report to Coveralls |
| 47 | + uses: coverallsapp/github-action@master |
| 48 | + with: |
| 49 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 50 | + flag-name: run-${{ matrix.os }}-node@${{ matrix.node-version }} |
| 51 | + path-to-lcov: ${{ github.workspace }}/coverage/lcov.info |
| 52 | + parallel: true |
| 53 | + |
| 54 | + posttest: |
| 55 | + name: Post-Test |
| 56 | + needs: test |
| 57 | + runs-on: ubuntu-latest |
| 58 | + steps: |
| 59 | + - name: Coveralls finished |
| 60 | + uses: coverallsapp/github-action@master |
| 61 | + with: |
| 62 | + github-token: ${{ secrets.github_token }} |
| 63 | + parallel-finished: true |
| 64 | + |
| 65 | + code-lint: |
| 66 | + name: Code Lint |
| 67 | + runs-on: ubuntu-latest |
| 68 | + steps: |
| 69 | + - uses: actions/checkout@v2 |
| 70 | + - name: Use Node.js 14 |
| 71 | + uses: actions/setup-node@v2 |
| 72 | + with: |
| 73 | + node-version: 14 |
| 74 | + - name: Bootstrap project |
| 75 | + run: npm ci --ignore-scripts |
| 76 | + - name: Verify code linting |
| 77 | + run: npm run lint |
| 78 | + |
| 79 | + commit-lint: |
| 80 | + name: Commit Lint |
| 81 | + runs-on: ubuntu-latest |
| 82 | + steps: |
| 83 | + - uses: actions/checkout@v2 |
| 84 | + with: |
| 85 | + fetch-depth: 0 |
| 86 | + - name: Use Node.js 14 |
| 87 | + uses: actions/setup-node@v2 |
| 88 | + with: |
| 89 | + node-version: 14 |
| 90 | + - name: Bootstrap project |
| 91 | + run: npm ci --ignore-scripts |
| 92 | + - name: Verify commit linting |
| 93 | + run: npx --no-install commitlint --from origin/master --to HEAD --verbose |
| 94 | + |
| 95 | + codeql: |
| 96 | + name: CodeQL |
| 97 | + runs-on: ubuntu-latest |
| 98 | + permissions: |
| 99 | + # See: https://github.com/github/codeql-action/blob/008b2cc71c4cf3401f45919d8eede44a65b4a322/README.md#usage |
| 100 | + security-events: write |
17 | 101 | steps: |
18 | | - - name: Git checkout |
| 102 | + - name: Checkout repository |
19 | 103 | uses: actions/checkout@v2 |
20 | 104 |
|
21 | | - - name: Use Node.js ${{ matrix.node-version }} |
22 | | - uses: actions/setup-node@v1 |
| 105 | + - name: Initialize CodeQL |
| 106 | + uses: github/codeql-action/init@v1 |
23 | 107 | with: |
24 | | - node-version: ${{ matrix.node-version }} |
| 108 | + languages: 'javascript' |
| 109 | + config-file: ./.github/codeql/codeql-config.yaml |
25 | 110 |
|
26 | | - - run: npm install |
27 | | - - run: npm test |
| 111 | + - name: Perform CodeQL Analysis |
| 112 | + uses: github/codeql-action/analyze@v1 |
0 commit comments