Merge pull request #850 from asaaki/dependabot/npm_and_yarn/node/type… #1727
This file contains 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: Continuous Integration | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
RUSTFLAGS: -Dwarnings | |
jobs: | |
build_and_test: | |
name: Build and test | |
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-at-edge-function-restrictions.html#lambda-at-edge-restrictions-runtime | |
# note: only use more recent active version; (close to) EOLs will be dropped | |
node-version: ['20'] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
# https://github.com/jetli/wasm-pack-action | |
- uses: jetli/wasm-pack-action@v0.4.0 | |
with: | |
version: 'latest' | |
# alternative: | |
# - name: Install wasm-pack | |
# run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: rust | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- run: make test | |
- run: make ci | |
checks: | |
name: Checks for fmt, clippy, and docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt, clippy | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: rust | |
- run: make ci.checks |