Unverified Commit fc096d04 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Keep using checkout instead of cache for building swc (#30923)

* Keep using checkout instead of cache for building swc

* test build

* re-add isRelease checks
parent 2301e615
...@@ -678,49 +678,48 @@ jobs: ...@@ -678,49 +678,48 @@ jobs:
run: sudo sysctl -w net.link.generic.system.hwcksum_tx=0 && sudo sysctl -w net.link.generic.system.hwcksum_rx=0 run: sudo sysctl -w net.link.generic.system.hwcksum_tx=0 && sudo sysctl -w net.link.generic.system.hwcksum_rx=0
if: ${{ matrix.os == 'macos-latest' }} if: ${{ matrix.os == 'macos-latest' }}
- uses: actions/cache@v2
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change')
id: docs-change
- name: Setup node - name: Setup node
uses: actions/setup-node@v2 uses: actions/setup-node@v2
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
with: with:
node-version: 14 node-version: 14
check-latest: true check-latest: true
# we use checkout here instead of the build cache since
# it can fail to restore in different OS'
- uses: actions/checkout@v2
# since the repo's dependencies aren't installed we need
# to install napi globally
- run: npm i -g @napi-rs/cli@1.2.1
- name: Install - name: Install
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
with: with:
profile: minimal profile: minimal
toolchain: nightly-2021-08-12 toolchain: nightly-2021-08-12
target: ${{ matrix.target }} target: ${{ matrix.target }}
- name: Cache cargo registry - name: Cache cargo registry
uses: actions/cache@v1 uses: actions/cache@v1
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
with: with:
path: ~/.cargo/registry path: ~/.cargo/registry
key: stable-${{ matrix.os }}-node@14-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }} key: stable-${{ matrix.os }}-node@14-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index - name: Cache cargo index
uses: actions/cache@v1 uses: actions/cache@v1
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
with: with:
path: ~/.cargo/git path: ~/.cargo/git
key: stable-${{ matrix.os }}-node@14-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }} key: stable-${{ matrix.os }}-node@14-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cache native binary - name: Cache native binary
id: binary-cache id: binary-cache
uses: actions/cache@v2 uses: actions/cache@v2
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
with: with:
path: packages/next/native/next-swc.${{ matrix.name }}.node path: packages/next/native/next-swc.${{ matrix.name }}.node
key: next-swc-nightly-2021-08-12-${{ matrix.target }}-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next/build/swc/**') }} key: next-swc-nightly-2021-08-12-${{ matrix.target }}-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next/build/swc/**') }}
- name: Cross build aarch64 setup - name: Cross build aarch64 setup
if: ${{ matrix.target == 'aarch64-apple-darwin' && steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }} if: ${{ matrix.target == 'aarch64-apple-darwin' }}
run: | run: |
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*; sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*;
export CC=$(xcrun -f clang); export CC=$(xcrun -f clang);
...@@ -738,19 +737,21 @@ jobs: ...@@ -738,19 +737,21 @@ jobs:
key: next-swc-cargo-cache-${{ matrix.os }}--${{ hashFiles('**/Cargo.lock') }} key: next-swc-cargo-cache-${{ matrix.os }}--${{ hashFiles('**/Cargo.lock') }}
restore-keys: | restore-keys: |
next-swc-cargo-cache-${{ matrix.os }} next-swc-cargo-cache-${{ matrix.os }}
- name: 'Build' - name: 'Build'
if: ${{ steps.binary-cache.outputs.cache-hit != 'true' && steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }} if: ${{ steps.binary-cache.outputs.cache-hit != 'true' }}
run: yarn build-native --release --target ${{ matrix.target }} run: yarn build-native --release --target ${{ matrix.target }}
env: env:
MACOSX_DEPLOYMENT_TARGET: '10.13' MACOSX_DEPLOYMENT_TARGET: '10.13'
working-directory: packages/next working-directory: packages/next
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v2.2.4 uses: actions/upload-artifact@v2.2.4
with: with:
name: next-swc-binaries name: next-swc-binaries
path: packages/next/native/next-swc.${{ matrix.name }}.node path: packages/next/native/next-swc.${{ matrix.name }}.node
- name: Clear the cargo caches - name: Clear the cargo caches
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
run: | run: |
cargo install cargo-cache --no-default-features --features ci-autoclean cargo install cargo-cache --no-default-features --features ci-autoclean
cargo-cache cargo-cache
...@@ -764,33 +765,28 @@ jobs: ...@@ -764,33 +765,28 @@ jobs:
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 32 CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 32
CARGO_PROFILE_RELEASE_LTO: 'false' CARGO_PROFILE_RELEASE_LTO: 'false'
steps: steps:
- uses: actions/cache@v2
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change')
id: docs-change
- name: Install node x86 - name: Install node x86
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
run: | run: |
choco install nodejs-lts --x86 -y --force choco install nodejs-lts --x86 -y --force
refreshenv refreshenv
- name: Set 32bit Node.js path - name: Set 32bit Node.js path
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
run: | run: |
echo "C:\\Program Files (x86)\\nodejs" >> $GITHUB_PATH echo "C:\\Program Files (x86)\\nodejs" >> $GITHUB_PATH
shell: bash shell: bash
- name: Node.js arch - name: Node.js arch
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
run: node -e "console.log(process.arch)" run: node -e "console.log(process.arch)"
# we use checkout here instead of the build cache since
# it can fail to restore in different OS'
- uses: actions/checkout@v2
# since the repo's dependencies aren't installed we need
# to install napi globally
- run: npm i -g @napi-rs/cli@1.2.1
- name: Install Rust - name: Install Rust
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
profile: minimal profile: minimal
...@@ -799,7 +795,6 @@ jobs: ...@@ -799,7 +795,6 @@ jobs:
target: i686-pc-windows-msvc target: i686-pc-windows-msvc
- name: Cache native binary - name: Cache native binary
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
id: binary-cache id: binary-cache
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
...@@ -807,13 +802,12 @@ jobs: ...@@ -807,13 +802,12 @@ jobs:
key: next-swc-nightly-2021-08-12-win32-ia32-msvc-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next/build/swc/**') }} key: next-swc-nightly-2021-08-12-win32-ia32-msvc-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next/build/swc/**') }}
- name: Build - name: Build
if: ${{ steps.binary-cache.outputs.cache-hit != 'true' && steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }} if: ${{ steps.binary-cache.outputs.cache-hit != 'true' }}
shell: bash shell: bash
run: yarn build-native --release --target i686-pc-windows-msvc run: yarn build-native --release --target i686-pc-windows-msvc
working-directory: packages/next working-directory: packages/next
- name: Upload artifact - name: Upload artifact
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: next-swc-binaries name: next-swc-binaries
...@@ -825,24 +819,20 @@ jobs: ...@@ -825,24 +819,20 @@ jobs:
name: next-swc - windows-aarch64 - node@14 name: next-swc - windows-aarch64 - node@14
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/cache@v2
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change')
id: docs-change
- name: Setup node - name: Setup node
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
uses: actions/setup-node@v2 uses: actions/setup-node@v2
with: with:
node-version: 14 node-version: 14
# we use checkout here instead of the build cache since
# it can fail to restore in different OS'
- uses: actions/checkout@v2
# since the repo's dependencies aren't installed we need
# to install napi globally
- run: npm i -g @napi-rs/cli@1.2.1
- name: Install Rust - name: Install Rust
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
profile: minimal profile: minimal
...@@ -851,7 +841,6 @@ jobs: ...@@ -851,7 +841,6 @@ jobs:
target: aarch64-pc-windows-msvc target: aarch64-pc-windows-msvc
- name: Cache native binary - name: Cache native binary
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
id: binary-cache id: binary-cache
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
...@@ -859,13 +848,12 @@ jobs: ...@@ -859,13 +848,12 @@ jobs:
key: next-swc-nightly-2021-08-12-win32-arm64-msvc-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next/build/swc/**') }} key: next-swc-nightly-2021-08-12-win32-arm64-msvc-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next/build/swc/**') }}
- name: Build - name: Build
if: ${{ steps.binary-cache.outputs.cache-hit != 'true' && steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }} if: ${{ steps.binary-cache.outputs.cache-hit != 'true' }}
shell: bash shell: bash
run: yarn build-native --release --target aarch64-pc-windows-msvc run: yarn build-native --release --target aarch64-pc-windows-msvc
working-directory: packages/next working-directory: packages/next
- name: Upload artifact - name: Upload artifact
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: next-swc-binaries name: next-swc-binaries
...@@ -877,18 +865,11 @@ jobs: ...@@ -877,18 +865,11 @@ jobs:
name: next-swc - linux-musl - node@lts name: next-swc - linux-musl - node@lts
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/cache@v2 # we use checkout here instead of the build cache since
if: ${{needs.build.outputs.docsChange != 'docs only change'}} # it can fail to restore in different OS'
id: restore-build - uses: actions/checkout@v2
with:
path: ./*
key: ${{ github.sha }}
- run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change')
id: docs-change
- name: Login to registry - name: Login to registry
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
run: | run: |
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
env: env:
...@@ -897,7 +878,6 @@ jobs: ...@@ -897,7 +878,6 @@ jobs:
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
- name: Cache - name: Cache
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: | path: |
...@@ -905,13 +885,11 @@ jobs: ...@@ -905,13 +885,11 @@ jobs:
key: linux-musl-publish-integration key: linux-musl-publish-integration
- name: Pull docker image - name: Pull docker image
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
run: | run: |
docker pull ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine docker pull ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
docker tag ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine builder docker tag ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine builder
- name: Cache native binary - name: Cache native binary
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
id: binary-cache id: binary-cache
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
...@@ -919,12 +897,11 @@ jobs: ...@@ -919,12 +897,11 @@ jobs:
key: next-swc-nightly-2021-08-12-linux-x64-musl-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next/build/swc/**') }} key: next-swc-nightly-2021-08-12-linux-x64-musl-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next/build/swc/**') }}
- name: 'Build' - name: 'Build'
if: ${{ steps.binary-cache.outputs.cache-hit != 'true' && steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }} if: ${{ steps.binary-cache.outputs.cache-hit != 'true' }}
run: | run: |
docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd)/packages/next:/build -w /build builder sh -c "npm i -g @napi-rs/cli@1.2.1 && yarn build-native --release --target x86_64-unknown-linux-musl" docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd)/packages/next:/build -w /build builder sh -c "npm i -g @napi-rs/cli@1.2.1 && yarn build-native --release --target x86_64-unknown-linux-musl"
- name: Upload artifact - name: Upload artifact
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: next-swc-binaries name: next-swc-binaries
...@@ -938,24 +915,20 @@ jobs: ...@@ -938,24 +915,20 @@ jobs:
steps: steps:
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset - run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
- uses: actions/cache@v2
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change')
id: docs-change
- name: Setup node - name: Setup node
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
uses: actions/setup-node@v2 uses: actions/setup-node@v2
with: with:
node-version: 14 node-version: 14
# we use checkout here instead of the build cache since
# it can fail to restore in different OS'
- uses: actions/checkout@v2
# since the repo's dependencies aren't installed we need
# to install napi globally
- run: npm i -g @napi-rs/cli@1.2.1
- name: Install Rust - name: Install Rust
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
profile: minimal profile: minimal
...@@ -964,7 +937,6 @@ jobs: ...@@ -964,7 +937,6 @@ jobs:
target: aarch64-unknown-linux-gnu target: aarch64-unknown-linux-gnu
- name: Cache - name: Cache
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: | path: |
...@@ -972,13 +944,11 @@ jobs: ...@@ -972,13 +944,11 @@ jobs:
key: aarch64-linux-gnu-publish-integration key: aarch64-linux-gnu-publish-integration
- name: Install cross compile toolchain - name: Install cross compile toolchain
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y
- name: Cache native binary - name: Cache native binary
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
id: binary-cache id: binary-cache
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
...@@ -986,12 +956,11 @@ jobs: ...@@ -986,12 +956,11 @@ jobs:
key: next-swc-nightly-2021-08-12-linux-arm64-gnu-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next/build/swc/**') }} key: next-swc-nightly-2021-08-12-linux-arm64-gnu-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next/build/swc/**') }}
- name: Cross build aarch64 - name: Cross build aarch64
if: ${{ steps.binary-cache.outputs.cache-hit != 'true' && steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }} if: ${{ steps.binary-cache.outputs.cache-hit != 'true' }}
run: yarn build-native --release --target aarch64-unknown-linux-gnu run: yarn build-native --release --target aarch64-unknown-linux-gnu
working-directory: packages/next working-directory: packages/next
- name: Upload artifact - name: Upload artifact
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: next-swc-binaries name: next-swc-binaries
...@@ -1003,24 +972,20 @@ jobs: ...@@ -1003,24 +972,20 @@ jobs:
name: next-swc - aarch64-unknown-linux-musl - node@14 name: next-swc - aarch64-unknown-linux-musl - node@14
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
steps: steps:
- uses: actions/cache@v2
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change')
id: docs-change
- name: Setup node - name: Setup node
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
uses: actions/setup-node@v2 uses: actions/setup-node@v2
with: with:
node-version: 14 node-version: 14
# we use checkout here instead of the build cache since
# it can fail to restore in different OS'
- uses: actions/checkout@v2
# since the repo's dependencies aren't installed we need
# to install napi globally
- run: npm i -g @napi-rs/cli@1.2.1
- name: Install Rust - name: Install Rust
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
profile: minimal profile: minimal
...@@ -1029,7 +994,6 @@ jobs: ...@@ -1029,7 +994,6 @@ jobs:
target: aarch64-unknown-linux-musl target: aarch64-unknown-linux-musl
- name: Cache - name: Cache
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: | path: |
...@@ -1037,13 +1001,11 @@ jobs: ...@@ -1037,13 +1001,11 @@ jobs:
key: aarch64-linux-musl-publish-integration key: aarch64-linux-musl-publish-integration
- name: Install cross compile toolchain - name: Install cross compile toolchain
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install gcc-aarch64-linux-gnu -y sudo apt-get install gcc-aarch64-linux-gnu -y
- name: Cache native binary - name: Cache native binary
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
id: binary-cache id: binary-cache
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
...@@ -1051,12 +1013,11 @@ jobs: ...@@ -1051,12 +1013,11 @@ jobs:
key: next-swc-nightly-2021-08-12-linux-arm64-musl-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next/build/swc/**') }} key: next-swc-nightly-2021-08-12-linux-arm64-musl-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next/build/swc/**') }}
- name: Cross build aarch64 - name: Cross build aarch64
if: ${{ steps.binary-cache.outputs.cache-hit != 'true' && steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }} if: ${{ steps.binary-cache.outputs.cache-hit != 'true' }}
run: yarn build-native --release --target aarch64-unknown-linux-musl run: yarn build-native --release --target aarch64-unknown-linux-musl
working-directory: packages/next working-directory: packages/next
- name: Upload artifact - name: Upload artifact
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: next-swc-binaries name: next-swc-binaries
...@@ -1070,24 +1031,20 @@ jobs: ...@@ -1070,24 +1031,20 @@ jobs:
steps: steps:
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset - run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
- uses: actions/cache@v2
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change')
id: docs-change
- name: Setup node - name: Setup node
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
uses: actions/setup-node@v2 uses: actions/setup-node@v2
with: with:
node-version: 14 node-version: 14
# we use checkout here instead of the build cache since
# it can fail to restore in different OS'
- uses: actions/checkout@v2
# since the repo's dependencies aren't installed we need
# to install napi globally
- run: npm i -g @napi-rs/cli@1.2.1
- name: Install Rust - name: Install Rust
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
profile: minimal profile: minimal
...@@ -1096,7 +1053,6 @@ jobs: ...@@ -1096,7 +1053,6 @@ jobs:
target: armv7-unknown-linux-gnueabihf target: armv7-unknown-linux-gnueabihf
- name: Cache - name: Cache
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: | path: |
...@@ -1104,13 +1060,11 @@ jobs: ...@@ -1104,13 +1060,11 @@ jobs:
key: arm7-linux-gnu-publish-integration key: arm7-linux-gnu-publish-integration
- name: Install cross compile toolchain - name: Install cross compile toolchain
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf -y sudo apt-get install gcc-arm-linux-gnueabihf -y
- name: Cache native binary - name: Cache native binary
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
id: binary-cache id: binary-cache
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
...@@ -1118,12 +1072,11 @@ jobs: ...@@ -1118,12 +1072,11 @@ jobs:
key: next-swc-nightly-2021-08-12-linux-arm-gnueabihf-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next/build/swc/**') }} key: next-swc-nightly-2021-08-12-linux-arm-gnueabihf-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next/build/swc/**') }}
- name: Cross build aarch64 - name: Cross build aarch64
if: ${{ steps.binary-cache.outputs.cache-hit != 'true' && steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }} if: ${{ steps.binary-cache.outputs.cache-hit != 'true' }}
run: yarn build-native --release --target armv7-unknown-linux-gnueabihf run: yarn build-native --release --target armv7-unknown-linux-gnueabihf
working-directory: packages/next working-directory: packages/next
- name: Upload artifact - name: Upload artifact
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: next-swc-binaries name: next-swc-binaries
...@@ -1135,24 +1088,20 @@ jobs: ...@@ -1135,24 +1088,20 @@ jobs:
name: next-swc - Android - aarch64 name: next-swc - Android - aarch64
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- uses: actions/cache@v2
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change')
id: docs-change
- name: Setup node - name: Setup node
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
uses: actions/setup-node@v2 uses: actions/setup-node@v2
with: with:
node-version: 14 node-version: 14
# we use checkout here instead of the build cache since
# it can fail to restore in different OS'
- uses: actions/checkout@v2
# since the repo's dependencies aren't installed we need
# to install napi globally
- run: npm i -g @napi-rs/cli@1.2.1
- name: Install Rust - name: Install Rust
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
profile: minimal profile: minimal
...@@ -1161,7 +1110,6 @@ jobs: ...@@ -1161,7 +1110,6 @@ jobs:
target: aarch64-linux-android target: aarch64-linux-android
- name: Cache native binary - name: Cache native binary
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
id: binary-cache id: binary-cache
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
...@@ -1169,7 +1117,7 @@ jobs: ...@@ -1169,7 +1117,7 @@ jobs:
key: next-swc-nightly-2021-08-12-android-arm64-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next/build/swc/**') }} key: next-swc-nightly-2021-08-12-android-arm64-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next/build/swc/**') }}
- name: Build - name: Build
if: ${{ steps.binary-cache.outputs.cache-hit != 'true' && steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }} if: ${{ steps.binary-cache.outputs.cache-hit != 'true' }}
shell: bash shell: bash
run: | run: |
export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android24-clang" export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android24-clang"
...@@ -1177,7 +1125,6 @@ jobs: ...@@ -1177,7 +1125,6 @@ jobs:
working-directory: packages/next working-directory: packages/next
- name: Upload artifact - name: Upload artifact
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: next-swc-binaries name: next-swc-binaries
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment