Merge pull request #1113 from napi-rs/upgrade-ci-config

ci: upgrade configuration
This commit is contained in:
LongYinan 2022-04-01 14:47:17 +08:00 committed by GitHub
commit ae45d335f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 144 additions and 230 deletions

View file

@ -25,7 +25,7 @@ task:
echo "~~~~ yarn --version ~~~~"
yarn --version
test_script:
- yarn install --immutable --network-timeout 300000
- yarn install --immutable --mode=skip-build
- yarn build
- cargo test -p napi-sys --lib -- --nocapture
- yarn build:test

View file

@ -14,7 +14,7 @@ jobs:
name: Build - Android - armv7
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
@ -34,31 +34,22 @@ jobs:
override: true
target: 'armv7-linux-androideabi'
- name: Generate Cargo.lock
uses: actions-rs/cargo@v1
- name: Cache cargo
uses: actions/cache@v3
with:
command: generate-lockfile
- name: Cache cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: stable-linux-android-armv7-node@16-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: stable-linux-android-node@16-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
path: |
~/.cargo/registry
~/.cargo/git
key: stable-linux-android-armv7-node@16-cargo-cache
- name: Cache NPM dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: node_modules
key: npm-cache-linux-android-node@16-${{ hashFiles('yarn.lock') }}
path: .yarn/cache
key: npm-cache-linux-android-node@16
- name: Install dependencies
run: yarn install --immutable --network-timeout 300000
run: yarn install --immutable --mode=skip-build
- name: 'Build TypeScript'
run: yarn build

View file

@ -14,7 +14,7 @@ jobs:
name: Build - Android - aarch64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
@ -34,31 +34,22 @@ jobs:
override: true
target: 'aarch64-linux-android'
- name: Generate Cargo.lock
uses: actions-rs/cargo@v1
- name: Cache cargo
uses: actions/cache@v3
with:
command: generate-lockfile
- name: Cache cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: stable-linux-android-node@16-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: stable-linux-android-node@16-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
path: |
~/.cargo/registry
~/.cargo/git
key: stable-linux-android-node@16-cargo-cache
- name: Cache NPM dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: node_modules
key: npm-cache-linux-android-node@16-${{ hashFiles('yarn.lock') }}
path: .yarn/cache
key: npm-cache-linux-android-node@16
- name: Install dependencies
run: yarn install --immutable --network-timeout 300000
run: yarn install --immutable --mode=skip-build
- name: 'Build TypeScript'
run: yarn build

View file

@ -11,22 +11,16 @@ on:
jobs:
build_and_test:
strategy:
fail-fast: false
matrix:
node: ['17']
os: [ubuntu-latest]
name: nightly - ${{ matrix.os }} - node@${{ matrix.node }}
runs-on: ${{ matrix.os }}
name: nightly - ubuntu - node@16
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
node-version: 16
check-latest: true
cache: 'yarn'
@ -38,31 +32,22 @@ jobs:
components: rust-src
override: true
- name: Generate Cargo.lock
uses: actions-rs/cargo@v1
- name: Cache cargo
uses: actions/cache@v3
with:
command: generate-lockfile
- name: Cache cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: nightly-${{ matrix.os }}-node@${{ matrix.node }}-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: nightly-${{ matrix.os }}gnu-node@${{ matrix.node }}-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
path: |
~/.cargo/registry
~/.cargo/git
key: nightly-ubuntu-node@16-cargo-cache
- name: Cache NPM dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: node_modules
key: npm-cache-${{ matrix.os }}-node@${{ matrix.node }}-${{ hashFiles('yarn.lock') }}
path: .yarn/cache
key: npm-cache-ubuntu-node@16
- name: 'Install dependencies'
run: yarn install --immutable --network-timeout 300000
run: yarn install --immutable --mode=skip-build
- name: 'Build TypeScript'
run: yarn build

View file

@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
@ -32,31 +32,22 @@ jobs:
profile: default
override: true
- name: Generate Cargo.lock
uses: actions-rs/cargo@v1
- name: Cache cargo
uses: actions/cache@v3
with:
command: generate-lockfile
- name: Cache cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: bench-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: bench-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
path: |
~/.cargo/registry
~/.cargo/git
key: bench-cargo-cache
- name: Cache NPM dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: node_modules
key: bench-${{ hashFiles('yarn.lock') }}
path: .yarn/cache
key: bench-yarn-cache
- name: 'Install dependencies'
run: yarn install --immutable --network-timeout 300000
run: yarn install --immutable --mode=skip-build
- name: 'Build ts'
run: yarn build

View file

@ -30,7 +30,7 @@ jobs:
profile: minimal
override: true
- name: Cache cargo registry
- name: Cache cargo
uses: actions/cache@v3
with:
path: |
@ -39,7 +39,7 @@ jobs:
key: stable-cargo-cache-build-binary
- name: 'Install dependencies'
run: yarn install --mode=skip-build --immutable --network-timeout 300000
run: yarn install --mode=skip-build --immutable
- name: 'Build TypeScript'
run: yarn build

View file

@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup QEMU
uses: docker/setup-qemu-action@v1
@ -65,7 +65,7 @@ jobs:
version: ['12', '14', '16', '17']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup QEMU
uses: docker/setup-qemu-action@v1

View file

@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
@ -29,31 +29,22 @@ jobs:
override: true
components: rustfmt, clippy
- name: Generate Cargo.lock
uses: actions-rs/cargo@v1
- name: Cache cargo
uses: actions/cache@v3
with:
command: generate-lockfile
- name: Cache cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: lint-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: lint-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
path: |
~/.cargo/registry
~/.cargo/git
key: lint-cargo-cache
- name: Cache NPM dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: node_modules
key: lint-${{ hashFiles('yarn.lock') }}
path: .yarn/cache
key: lint-yarn-cache
- name: 'Install dependencies'
run: yarn install --immutable --network-timeout 300000
run: yarn install --immutable --mode=skip-build
- name: 'Lint JS/TS'
run: yarn lint

View file

@ -17,7 +17,7 @@ jobs:
steps:
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
@ -26,24 +26,14 @@ jobs:
check-latest: true
cache: 'yarn'
- name: Install
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Install aarch64 toolchain
run: rustup target add aarch64-unknown-linux-gnu
- name: Cache NPM dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: node_modules
key: npm-cache-linux-aarch64-gnu-node@16-${{ hashFiles('yarn.lock') }}
path: .yarn/cache
key: npm-cache-linux-aarch64-gnu-node@16
- name: Install dependencies
run: yarn install --immutable --network-timeout 300000
run: yarn install --immutable --mode=skip-build
- name: 'Build TypeScript'
run: yarn build

View file

@ -18,7 +18,7 @@ jobs:
steps:
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
@ -37,28 +37,19 @@ jobs:
- name: Install aarch64 toolchain
run: rustup target add aarch64-unknown-linux-gnu
- name: Generate Cargo.lock
uses: actions-rs/cargo@v1
- name: Cache cargo
uses: actions/cache@v3
with:
command: generate-lockfile
- name: Cache cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: stable-linux-aarch64-gnu-node@16-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: stable-linux-aarch64-gnu-node@16-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
path: |
~/.cargo/registry
~/.cargo/git
key: stable-linux-aarch64-gnu-node@16-cargo-cache
- name: Cache NPM dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: node_modules
key: npm-cache-linux-aarch64-gnu-node@16-${{ hashFiles('yarn.lock') }}
path: .yarn/cache
key: npm-cache-linux-aarch64-gnu-node@16
- name: Install cross compile toolchain
run: |
@ -66,7 +57,7 @@ jobs:
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y
- name: Install dependencies
run: yarn install --immutable --network-timeout 300000
run: yarn install --immutable --mode=skip-build
- name: 'Build TypeScript'
run: yarn build

View file

@ -18,7 +18,7 @@ jobs:
steps:
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
@ -42,7 +42,7 @@ jobs:
with:
command: generate-lockfile
- name: Cache cargo registry
- name: Cache cargo
uses: actions/cache@v2
with:
path: ~/.cargo/registry
@ -66,7 +66,7 @@ jobs:
sudo apt-get install gcc-arm-linux-gnueabihf -y
- name: Install dependencies
run: yarn install --immutable --network-timeout 300000
run: yarn install --immutable --mode=skip-build
- name: 'Build TypeScript'
run: yarn build

View file

@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
@ -25,7 +25,7 @@ jobs:
cache: 'yarn'
- name: 'Install dependencies'
run: yarn install --immutable --network-timeout 300000
run: yarn install --immutable --mode=skip-build
- name: 'Build TypeScript'
run: yarn build

View file

@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
@ -31,37 +31,23 @@ jobs:
profile: minimal
override: true
- name: Generate Cargo.lock
uses: actions-rs/cargo@v1
- name: Cache cargo
uses: actions/cache@v3
with:
command: generate-lockfile
- name: Cache cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: stable-memory-leak-detect-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: stable-memory-leak-detect-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v2
with:
path: target
key: stable-memory-leak-detect-cargo-build-trimmed-${{ hashFiles('**/Cargo.lock') }}
path: |
~/.cargo/registry
~/.cargo/git
target
key: stable-memory-leak-detect-cargo-cache
- name: Cache NPM dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: node_modules
key: memory-leak-detect-${{ hashFiles('yarn.lock') }}
path: .yarn/cache
key: memory-leak-detect
- name: 'Install dependencies'
run: yarn install --immutable --network-timeout 300000
run: yarn install --immutable
- name: 'Build TypeScript'
run: yarn build

View file

@ -21,7 +21,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
@ -37,25 +37,22 @@ jobs:
profile: minimal
override: true
- name: Generate Cargo.lock
uses: actions-rs/cargo@v1
- name: Cache cargo
uses: actions/cache@v3
with:
command: generate-lockfile
path: |
~/.cargo/registry
~/.cargo/git
key: stable-${{ matrix.os }}-node@${{ matrix.node }}-cargo-cache
- name: Cache cargo registry
uses: actions/cache@v2
- name: Cache NPM dependencies
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: stable-${{ matrix.os }}-node@${{ matrix.node }}-cargo-registry
- name: Cache cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: stable-${{ matrix.os }}-node@${{ matrix.node }}-cargo-index
path: .yarn/cache
key: npm-cache-${{ matrix.os }}-node@${{ matrix.node }}
- name: 'Install dependencies'
run: yarn install --mode=skip-build --immutable --network-timeout 300000
run: yarn install --mode=skip-build --immutable
- name: 'Build TypeScript'
run: yarn build

View file

@ -15,7 +15,7 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
@ -25,7 +25,7 @@ jobs:
cache: 'yarn'
- name: 'Install dependencies'
run: yarn install --mode=skip-build --immutable --network-timeout 300000
run: yarn install --mode=skip-build --immutable
- name: 'Build TypeScript'
run: yarn build
@ -36,26 +36,21 @@ jobs:
toolchain: stable
profile: minimal
override: true
target: aarch64-pc-windows-msvc
- name: Install arm64 toolchain
run: rustup target add aarch64-pc-windows-msvc
- name: Generate Cargo.lock
uses: actions-rs/cargo@v1
- name: Cache NPM dependencies
uses: actions/cache@v3
with:
command: generate-lockfile
path: .yarn/cache
key: npm-cache-windows-aarch64-msvc-node@16
- name: Cache cargo registry
uses: actions/cache@v2
- name: Cache cargo
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: stable-windows-arm64-node@lts-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: stable-windows-arm64-node@lts-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
path: |
~/.cargo/registry
~/.cargo/git
key: stable-windows-arm64-node@16-cargo-cache
- name: Check build
uses: actions-rs/cargo@v1

View file

@ -15,7 +15,7 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
@ -25,6 +25,12 @@ jobs:
architecture: 'x64'
cache: 'yarn'
- name: Cache NPM dependencies
uses: actions/cache@v3
with:
path: .yarn/cache
key: npm-cache-windows-i686-msvc-node@16
- name: 'Install dependencies'
run: |
yarn install --mode=skip-build --immutable
@ -40,14 +46,14 @@ jobs:
override: true
target: i686-pc-windows-msvc
- name: Cache cargo registry
uses: actions/cache@v2
- name: Cache cargo
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: stable-windows-i686-node@lts-cargo-registry
- name: Cache cargo index
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: stable-windows-i686-node@lts-cargo-index

View file

@ -25,7 +25,7 @@ jobs:
steps:
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
@ -47,12 +47,12 @@ jobs:
with:
version: 0.9.1
- name: Cache NPM dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: node_modules
key: npm-cache-linux-aarch64-gnu-node@16-${{ hashFiles('yarn.lock') }}
path: .yarn/cache
key: npm-cache-linux-aarch64-gnu-node@16
- name: Install dependencies
run: yarn install --immutable --network-timeout 300000
run: yarn install --immutable --mode=skip-build
- name: 'Build TypeScript'
run: yarn build
- name: Cross build native tests
@ -91,7 +91,7 @@ jobs:
steps:
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
if: matrix.settings.host == 'ubuntu-latest'
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
@ -99,19 +99,19 @@ jobs:
check-latest: true
cache: 'yarn'
- name: Cache NPM dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: node_modules
key: npm-cache-${{ matrix.settings.host }}-node@16-${{ hashFiles('yarn.lock') }}
path: .yarn/cache
key: npm-cache-${{ matrix.settings.host }}-node@16
- name: Install dependencies
run: yarn install --immutable --network-timeout 300000
run: yarn install --immutable --mode=skip-build
- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: napi-${{ matrix.settings.target }}
path: ./examples/napi/
- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: compat-${{ matrix.settings.target }}
path: ./examples/napi-compat-mode/

View file

@ -150,7 +150,7 @@ jobs:
with:
command: generate-lockfile
- name: Cache cargo registry
- name: Cache cargo
uses: actions/cache@v2
with:
path: ~/.cargo/registry