Sync alphalib 2025 09 16 (#251) #308
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '*' | |
| jobs: | |
| pack: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - run: corepack yarn | |
| - run: corepack yarn pack | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: package | |
| path: '*.tgz' | |
| biome: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - run: corepack yarn | |
| - run: corepack yarn lint:js | |
| typescript: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - run: corepack yarn | |
| - run: corepack yarn lint:ts | |
| vitest: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node: | |
| - 20 | |
| - 22 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - run: corepack yarn | |
| - run: corepack yarn test:unit | |
| - name: Upload coverage reports artifact | |
| if: matrix.node == 22 # Only upload coverage from the latest Node.js version | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-reports | |
| path: coverage/ | |
| coverage: | |
| needs: vitest | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: coverage-reports | |
| path: coverage | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage/lcov.info | |
| flags: unittests | |
| name: node-sdk | |
| fail_ci_if_error: true | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - pack | |
| - biome | |
| - typescript | |
| - vitest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| permissions: | |
| id-token: write | |
| contents: write | |
| steps: | |
| - uses: softprops/action-gh-release@v1 | |
| with: | |
| draft: true | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: https://registry.npmjs.org | |
| - uses: actions/download-artifact@v4 | |
| with: { name: package } | |
| - run: npm publish *.tgz --provenance | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |