napi-rs/.github/workflows/linux-musl.yaml

55 lines
1.9 KiB
YAML
Raw Normal View History

2020-10-14 17:15:20 +09:00
name: Linux musl
env:
DEBUG: 'napi:*'
2020-08-17 23:36:09 +09:00
on:
push:
2020-12-03 17:30:14 +09:00
branches:
- main
2020-08-17 23:36:09 +09:00
pull_request:
jobs:
build:
2021-03-19 12:53:48 +09:00
name: stable - x86_64-unknown-linux-musl - node@lts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
2020-11-26 15:30:19 +09:00
- name: Cache cargo registry
2021-07-30 14:20:40 +09:00
uses: actions/cache@v2
2020-11-26 15:30:19 +09:00
with:
path: ~/.cargo/registry
2021-03-19 12:53:48 +09:00
key: stable-alpine-node-alpine-@lts-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
2020-11-26 15:30:19 +09:00
- name: Cache cargo index
2021-07-30 14:20:40 +09:00
uses: actions/cache@v2
2020-11-26 15:30:19 +09:00
with:
path: ~/.cargo/git
2021-03-19 12:53:48 +09:00
key: stable-alpine-node-alpine-@lts-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
2020-11-26 15:30:19 +09:00
2021-03-19 12:53:48 +09:00
- name: Pull docker image
run: |
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
docker pull $DOCKER_REGISTRY_URL/${{ github.repository }}/nodejs-rust:lts-alpine
docker tag $DOCKER_REGISTRY_URL/${{ github.repository }}/nodejs-rust:lts-alpine builder
env:
DOCKER_REGISTRY_URL: ghcr.io
DOCKER_USERNAME: ${{ github.actor }}
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
2020-07-29 23:04:47 +09:00
- name: 'Install node dependencies'
2020-11-26 15:30:19 +09:00
run: docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/napi-rs -w /napi-rs builder yarn
2020-07-29 23:04:47 +09:00
- name: 'Build TypeScript'
2020-11-26 15:30:19 +09:00
run: docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/napi-rs -w /napi-rs builder yarn build
2020-07-29 23:04:47 +09:00
- name: Run check
run: |
2020-11-26 15:30:19 +09:00
docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/napi-rs -w /napi-rs builder cargo check -vvv
- name: Unit test
run: |
2021-03-19 12:53:48 +09:00
docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/napi-rs -w /napi-rs -e RUST_BACKTRACE=1 builder sh -c "yarn build:test && yarn test"