49 lines
1.6 KiB
YAML
49 lines
1.6 KiB
YAML
name: Linux musl
|
|
|
|
env:
|
|
DEBUG: 'napi:*'
|
|
|
|
on:
|
|
push:
|
|
branches: [master, develop]
|
|
pull_request:
|
|
|
|
jobs:
|
|
build:
|
|
name: stable - x86_64-unknown-linux-musl - node@14
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- 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: |
|
|
docker pull docker.pkg.github.com/napi-rs/napi-rs/rust-nodejs-alpine:lts
|
|
docker tag docker.pkg.github.com/napi-rs/napi-rs/rust-nodejs-alpine:lts builder
|
|
|
|
- name: 'Install node dependencies'
|
|
run: docker run --rm -v $(pwd)/.cargo:/root/.cargo -v $(pwd):/napi-rs -w /napi-rs builder yarn
|
|
|
|
- name: 'Install swc musl'
|
|
run: docker run --rm -v $(pwd)/.cargo:/root/.cargo -v $(pwd):/napi-rs -w /napi-rs builder yarn add @swc/core-linux-musl --dev
|
|
|
|
- name: 'Build TypeScript'
|
|
run: docker run --rm -v $(pwd)/.cargo:/root/.cargo -v $(pwd):/napi-rs -w /napi-rs builder yarn build
|
|
|
|
- name: Run check
|
|
run: |
|
|
docker run --rm -v $(pwd)/.cargo:/root/.cargo -v $(pwd):/napi-rs -w /napi-rs builder cargo check -vvv
|
|
|
|
- name: Unit test
|
|
run: |
|
|
docker run --rm -v $(pwd)/.cargo:/root/.cargo -v $(pwd):/napi-rs -w /napi-rs builder sh -c "yarn build:test && yarn test"
|
|
env:
|
|
RUST_BACKTRACE: 1
|