|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - "master" |
| 7 | + pull_request: |
| 8 | + |
| 9 | +env: |
| 10 | + default_node_version: 14 |
| 11 | + |
| 12 | +jobs: |
| 13 | + test: |
| 14 | + name: Test |
| 15 | + needs: build |
| 16 | + runs-on: ${{ matrix.os }} |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 20 | + node-version: ["14", "16", "18"] |
| 21 | + fail-fast: false |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v4 |
| 24 | + - name: Setup Node.js ${{ matrix.node-version }} and Cache |
| 25 | + uses: actions/setup-node@v4 |
| 26 | + with: |
| 27 | + node-version: ${{ matrix.node-version }} |
| 28 | + cache: npm |
| 29 | + cache-dependency-path: "package.json" |
| 30 | + |
| 31 | + - name: Install Dependencies |
| 32 | + run: npm install |
| 33 | + - name: Test |
| 34 | + run: npm run test |
| 35 | + |
| 36 | + coverage: |
| 37 | + name: Coverage |
| 38 | + needs: build |
| 39 | + runs-on: ubuntu-latest |
| 40 | + steps: |
| 41 | + - uses: actions/checkout@v4 |
| 42 | + - name: Setup Node.js ${{env.default_node_version}} and Cache |
| 43 | + uses: actions/setup-node@v4 |
| 44 | + with: |
| 45 | + node-version: ${{env.default_node_version}} |
| 46 | + cache: npm |
| 47 | + cache-dependency-path: "package.json" |
| 48 | + |
| 49 | + - name: Install Dependencies |
| 50 | + run: npm install |
| 51 | + - name: Coverage |
| 52 | + run: npm run test-cov |
| 53 | + - name: Coveralls |
| 54 | + uses: coverallsapp/github-action@v2 |
| 55 | + with: |
| 56 | + github-token: ${{ secrets.github_token }} |
| 57 | + |
| 58 | + build: |
| 59 | + name: Build |
| 60 | + runs-on: ubuntu-latest |
| 61 | + steps: |
| 62 | + - uses: actions/checkout@v4 |
| 63 | + - name: Setup Node.js ${{env.default_node_version}} and Cache |
| 64 | + uses: actions/setup-node@v4 |
| 65 | + with: |
| 66 | + node-version: ${{env.default_node_version}} |
| 67 | + cache: npm |
| 68 | + cache-dependency-path: "package.json" |
| 69 | + |
| 70 | + - name: Install Dependencies |
| 71 | + run: npm install |
| 72 | + - name: Build |
| 73 | + run: npm run build |
| 74 | + |
| 75 | + lint: |
| 76 | + name: Lint |
| 77 | + runs-on: ubuntu-latest |
| 78 | + steps: |
| 79 | + - uses: actions/checkout@v4 |
| 80 | + - name: Setup Node.js ${{env.default_node_version}} and Cache |
| 81 | + uses: actions/setup-node@v4 |
| 82 | + with: |
| 83 | + node-version: ${{env.default_node_version}} |
| 84 | + cache: npm |
| 85 | + cache-dependency-path: "package.json" |
| 86 | + |
| 87 | + - name: Install Dependencies |
| 88 | + run: npm install |
| 89 | + - name: Lint |
| 90 | + run: npm run eslint |
0 commit comments