2020-10-14 17:15:20 +09:00
|
|
|
name: Linux musl
|
2020-06-10 19:55:40 +09:00
|
|
|
|
2020-10-15 17:14:11 +09:00
|
|
|
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:
|
2020-06-10 19:55:40 +09:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2020-11-26 15:30:19 +09:00
|
|
|
name: stable - x86_64-unknown-linux-musl - node@10
|
2020-06-10 19:55:40 +09:00
|
|
|
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
|
|
|
|
2020-06-10 19:55:40 +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-06-10 19:55:40 +09:00
|
|
|
|
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
|
|
|
|
2020-06-10 19:55:40 +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
|
2020-06-10 19:55:40 +09:00
|
|
|
|
2020-06-17 21:33:28 +09:00
|
|
|
- name: Unit test
|
2020-06-10 19:55:40 +09:00
|
|
|
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"
|
2020-06-10 19:55:40 +09:00
|
|
|
env:
|
|
|
|
RUST_BACKTRACE: 1
|