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

60 lines
2 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:
2020-11-26 15:30:19 +09:00
name: stable - x86_64-unknown-linux-musl - node@10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
2020-11-26 15:30:19 +09:00
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
2020-11-28 01:44:53 +09:00
key: stable-alpine-node-alpine-@10-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
2020-11-26 15:30:19 +09:00
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
2020-11-28 01:44:53 +09:00
key: stable-alpine-node-alpine-@10-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
2020-11-26 15:30:19 +09:00
- name: Log in to registry
run: |
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
env:
DOCKER_REGISTRY_URL: docker.pkg.github.com
DOCKER_USERNAME: ${{ github.actor }}
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
- name: Pull docker image
run: |
2020-11-26 15:30:19 +09:00
docker pull docker.pkg.github.com/napi-rs/napi-rs/nodejs-rust:10-alpine
docker tag docker.pkg.github.com/napi-rs/napi-rs/nodejs-rust:10-alpine builder
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: |
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 sh -c "yarn build:test && yarn test"
env:
RUST_BACKTRACE: 1