|
| 1 | +name: CI |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + - master |
| 7 | + tags: |
| 8 | + - '!*' # Do not execute on tags |
| 9 | +env: |
| 10 | + NAME: ${{vars.NAME}} |
| 11 | + EMAIL: ${{vars.EMAIL}} |
| 12 | + NPM_TOKEN: ${{secrets.NPM_TOKEN}} |
| 13 | + GITHUB_TOKEN: ${{secrets.GH_TOKEN}} |
| 14 | + CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}} |
| 15 | + FORCE_COLOR: 1 |
| 16 | + |
| 17 | + |
| 18 | +jobs: |
| 19 | + test: |
| 20 | + strategy: |
| 21 | + matrix: |
| 22 | + platform: [ubuntu-latest, windows-latest, macOS-latest] |
| 23 | + node: [20.x, 22.x] |
| 24 | + name: Test with Node ${{matrix.node}} on ${{matrix.platform}} |
| 25 | + runs-on: ${{matrix.platform}} |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v4 |
| 28 | + - uses: actions/setup-node@v3 |
| 29 | + with: |
| 30 | + node-version: ${{matrix.node}} |
| 31 | + - run: npm ci |
| 32 | + - run: npm test |
| 33 | + |
| 34 | + |
| 35 | + coverage: |
| 36 | + name: Publish coverage |
| 37 | + needs: [test] |
| 38 | + runs-on: ubuntu-latest |
| 39 | + steps: |
| 40 | + - uses: actions/checkout@v4 |
| 41 | + - uses: actions/setup-node@v3 |
| 42 | + with: |
| 43 | + node-version: 22.x |
| 44 | + - run: npm ci |
| 45 | + - run: npm test |
| 46 | + - uses: paambaati/[email protected] |
| 47 | + - uses: coverallsapp/github-action@master |
| 48 | + with: |
| 49 | + github-token: ${{secrets.GITHUB_TOKEN}} |
| 50 | + |
| 51 | + |
| 52 | + docs: |
| 53 | + name: Publish docs |
| 54 | + needs: [test] |
| 55 | + runs-on: ubuntu-latest |
| 56 | + steps: |
| 57 | + - uses: actions/checkout@v4 |
| 58 | + - uses: actions/setup-node@v3 |
| 59 | + with: |
| 60 | + node-version: 22.x |
| 61 | + |
| 62 | + - run: npm i -g typescript typedoc |
| 63 | + - run: npm ci |
| 64 | + - run: npm run publish-docs |
| 65 | + |
| 66 | + |
| 67 | + packages: |
| 68 | + name: Publish packages |
| 69 | + needs: [test] |
| 70 | + runs-on: ubuntu-latest |
| 71 | + steps: |
| 72 | + - uses: actions/checkout@v4 |
| 73 | + - uses: actions/setup-node@v3 |
| 74 | + with: |
| 75 | + node-version: 22.x |
| 76 | + |
| 77 | + with: |
| 78 | + entries: access = public |
| 79 | + - run: npm i -g typescript rollup typedoc browserify terser |
| 80 | + - run: npm ci |
| 81 | + - run: npm run publish-packages |
0 commit comments