|
| 1 | +name: Node.js CI |
| 2 | + |
| 3 | +on: [push] |
| 4 | + |
| 5 | +jobs: |
| 6 | + test-node: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + timeout-minutes: 10 |
| 9 | + strategy: |
| 10 | + matrix: |
| 11 | + node-version: [10.x, 12.x, 14.x] |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v2 |
| 14 | + - name: Use Node.js ${{ matrix.node-version }} |
| 15 | + uses: actions/setup-node@v1 |
| 16 | + with: |
| 17 | + node-version: ${{ matrix.node-version }} |
| 18 | + - name: Install |
| 19 | + run: npm install |
| 20 | + - name: Fetch test suite |
| 21 | + run: npm run fetch-test-suite |
| 22 | + - name: Run test with Node.js ${{ matrix.node-version }} |
| 23 | + run: npm run test-node |
| 24 | + test-karma: |
| 25 | + runs-on: ubuntu-latest |
| 26 | + timeout-minutes: 10 |
| 27 | + strategy: |
| 28 | + matrix: |
| 29 | + node-version: [14.x] |
| 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 | + - run: npm install |
| 37 | + - name: Run karma tests |
| 38 | + run: npm run test-karma |
| 39 | + lint: |
| 40 | + runs-on: ubuntu-latest |
| 41 | + timeout-minutes: 10 |
| 42 | + strategy: |
| 43 | + matrix: |
| 44 | + node-version: [14.x] |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@v2 |
| 47 | + - name: Use Node.js ${{ matrix.node-version }} |
| 48 | + uses: actions/setup-node@v1 |
| 49 | + with: |
| 50 | + node-version: ${{ matrix.node-version }} |
| 51 | + - run: npm install |
| 52 | + - name: Run eslint |
| 53 | + run: npm run lint |
| 54 | + coverage: |
| 55 | + needs: [test-node, test-karma] |
| 56 | + runs-on: ubuntu-latest |
| 57 | + timeout-minutes: 10 |
| 58 | + strategy: |
| 59 | + matrix: |
| 60 | + node-version: [14.x] |
| 61 | + steps: |
| 62 | + - uses: actions/checkout@v2 |
| 63 | + - name: Use Node.js ${{ matrix.node-version }} |
| 64 | + uses: actions/setup-node@v1 |
| 65 | + with: |
| 66 | + node-version: ${{ matrix.node-version }} |
| 67 | + - name: Install |
| 68 | + run: npm install |
| 69 | + - name: Fetch test suite |
| 70 | + run: npm run fetch-test-suite |
| 71 | + - name: Generate coverage report |
| 72 | + run: npm run coverage-ci |
| 73 | + - name: Upload coverage to Codecov |
| 74 | + uses: codecov/codecov-action@v1 |
| 75 | + with: |
| 76 | + file: ./coverage/lcov.info |
| 77 | + fail_ci_if_error: true |
0 commit comments