mirror of
https://github.com/emn178/js-sha3.git
synced 2026-08-12 19:41:36 +08:00
- GitHub Actions CI across Node.js 18, 20, 22, and 24 against the packed npm artifact - GitHub Actions publish workflow on release with npm trusted publishing - `prepack` script to build distributions before `npm pack` / `npm publish` ### Changed - Replace Travis CI with GitHub Actions - Update README badges to GitHub Actions, npm, and jsDelivr - Upgrade mocha and pin vulnerable transitive dependencies via npm overrides
78 lines
1.8 KiB
YAML
78 lines
1.8 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Node 24
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 24.x
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Pack npm package
|
|
run: |
|
|
mkdir -p package-artifact
|
|
npm pack --pack-destination package-artifact
|
|
|
|
- name: Upload package artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: package-node-24
|
|
path: package-artifact/*.tgz
|
|
if-no-files-found: error
|
|
|
|
runtime-test:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [18.x, 20.x, 22.x, 24.x]
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Node ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Download package artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: package-node-24
|
|
path: package-artifact
|
|
|
|
- name: Extract package artifact
|
|
run: tar -xzf package-artifact/*.tgz --strip-components=1 -C .
|
|
|
|
- name: Run runtime tests
|
|
if: matrix.node-version != '24.x'
|
|
run: npm run test:runtime
|
|
|
|
- name: Run runtime tests with coverage
|
|
if: matrix.node-version == '24.x'
|
|
run: npm run test:coverage
|
|
|
|
- name: Upload to coveralls
|
|
if: matrix.node-version == '24.x'
|
|
uses: coverallsapp/github-action@v2
|
|
with:
|
|
file: ./coverage/lcov.info
|