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:
|
2021-03-19 12:53:48 +09:00
|
|
|
name: stable - x86_64-unknown-linux-musl - node@lts
|
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
|
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
|
2020-06-10 19:55:40 +09:00
|
|
|
run: |
|
|
|
|
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
|
2021-04-12 12:10:50 +09:00
|
|
|
docker pull $DOCKER_REGISTRY_URL/${{ github.repository }}/nodejs-rust:lts-alpine
|
|
|
|
docker tag $DOCKER_REGISTRY_URL/${{ github.repository }}/nodejs-rust:lts-alpine builder
|
2020-06-10 19:55:40 +09:00
|
|
|
env:
|
2021-04-12 12:10:50 +09:00
|
|
|
DOCKER_REGISTRY_URL: ghcr.io
|
2020-06-10 19:55:40 +09:00
|
|
|
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
|
|
|
|
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: |
|
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"
|