|
| 1 | +name: Next.js Instrumentation CI |
| 2 | + |
| 3 | +on: [push, pull_request, workflow_dispatch] |
| 4 | + |
| 5 | +env: |
| 6 | + # Enable versioned runner quiet mode to make CI output easier to read: |
| 7 | + OUTPUT_MODE: quiet |
| 8 | + |
| 9 | +jobs: |
| 10 | + lint: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + node-version: [lts/*] |
| 16 | + |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v3 |
| 19 | + - name: Use Node.js ${{ matrix.node-version }} |
| 20 | + uses: actions/setup-node@v3 |
| 21 | + with: |
| 22 | + node-version: ${{ matrix.node-version }} |
| 23 | + - name: Install Dependencies |
| 24 | + run: npm install |
| 25 | + - name: Run Linting |
| 26 | + run: npm run lint |
| 27 | + - name: Inspect Lockfile |
| 28 | + run: npm run lint:lockfile |
| 29 | + |
| 30 | + unit: |
| 31 | + runs-on: ubuntu-latest |
| 32 | + |
| 33 | + strategy: |
| 34 | + matrix: |
| 35 | + node-version: [16.x, 18.x, 20.x, 22.x] |
| 36 | + |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v3 |
| 39 | + - name: Use Node.js ${{ matrix.node-version }} |
| 40 | + uses: actions/setup-node@v3 |
| 41 | + with: |
| 42 | + node-version: ${{ matrix.node-version }} |
| 43 | + - name: Install Dependencies |
| 44 | + run: npm install |
| 45 | + - name: Run Unit Tests |
| 46 | + run: npm run unit |
| 47 | + - name: Post Unit Test Coverage |
| 48 | + uses: codecov/codecov-action@v3 |
| 49 | + with: |
| 50 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 51 | + directory: ./coverage/unit/ |
| 52 | + files: lcov.info |
| 53 | + flags: unit-tests-${{ matrix.node-version }} |
| 54 | + |
| 55 | + versioned: |
| 56 | + runs-on: ubuntu-latest |
| 57 | + |
| 58 | + strategy: |
| 59 | + matrix: |
| 60 | + node-version: [16.x, 18.x, 20.x, 22.x] |
| 61 | + |
| 62 | + steps: |
| 63 | + - uses: actions/checkout@v3 |
| 64 | + - name: Use Node.js ${{ matrix.node-version }} |
| 65 | + uses: actions/setup-node@v3 |
| 66 | + with: |
| 67 | + node-version: ${{ matrix.node-version }} |
| 68 | + - name: Install Dependencies |
| 69 | + run: npm install |
| 70 | + - name: Run Versioned Tests |
| 71 | + run: npm run versioned |
| 72 | + - name: Post Versioned Test Coverage |
| 73 | + uses: codecov/codecov-action@v3 |
| 74 | + with: |
| 75 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 76 | + directory: ./coverage/versioned/ |
| 77 | + files: lcov.info |
| 78 | + flags: versioned-tests-${{ matrix.node-version }} |
0 commit comments