Unverified Commit 2012f4e7 authored by LongYinan's avatar LongYinan Committed by GitHub

Update components in GitHub Actions (#36669)

`build-native` jobs tested on https://github.com/vercel/next.js/runs/6288266017
parent 3e78f0cb
This diff is collapsed.
...@@ -13,7 +13,7 @@ jobs: ...@@ -13,7 +13,7 @@ jobs:
- name: tune linux network - name: tune linux network
run: sudo ethtool -K eth0 tx off rx off run: sudo ethtool -K eth0 tx off rx off
- uses: actions/checkout@v2 - uses: actions/checkout@v3
with: with:
fetch-depth: 25 fetch-depth: 25
...@@ -21,10 +21,10 @@ jobs: ...@@ -21,10 +21,10 @@ jobs:
id: docs-change id: docs-change
- name: Setup node - name: Setup node
uses: actions/setup-node@v2 uses: actions/setup-node@v3
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }} if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
with: with:
node-version: 14 node-version: 16
check-latest: true check-latest: true
- name: Install - name: Install
...@@ -54,7 +54,7 @@ jobs: ...@@ -54,7 +54,7 @@ jobs:
- name: Turbo Cache - name: Turbo Cache
id: turbo-cache id: turbo-cache
uses: actions/cache@v2 uses: actions/cache@v3
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }} if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
with: with:
path: .turbo path: .turbo
...@@ -68,7 +68,7 @@ jobs: ...@@ -68,7 +68,7 @@ jobs:
# "If there are multiple partial matches for a restore key, the action returns the most recently created cache." # "If there are multiple partial matches for a restore key, the action returns the most recently created cache."
# So we get latest cache # So we get latest cache
- name: Cache built files - name: Cache built files
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: ./packages/next-target path: ./packages/next-target
key: next-swc-cargo-cache-ubuntu-18.04--${{ hashFiles('**/Cargo.lock') }} key: next-swc-cargo-cache-ubuntu-18.04--${{ hashFiles('**/Cargo.lock') }}
...@@ -77,8 +77,8 @@ jobs: ...@@ -77,8 +77,8 @@ jobs:
# since the repo's dependencies aren't installed we need # since the repo's dependencies aren't installed we need
# to install napi globally # to install napi globally
- run: npm i -g @napi-rs/cli@1.2.1 - run: npm i -g @napi-rs/cli@2.7.0
- run: npm i -g turbo@1.0.28 - run: npm i -g turbo@1.2.6
- name: Build - name: Build
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }} if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
...@@ -90,7 +90,7 @@ jobs: ...@@ -90,7 +90,7 @@ jobs:
TURBO_PROJECT: nextjs TURBO_PROJECT: nextjs
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v2.2.4 uses: actions/upload-artifact@v3
with: with:
name: next-swc-dev-binary name: next-swc-dev-binary
path: packages/next-swc/native/next-swc.linux-x64-gnu.node path: packages/next-swc/native/next-swc.linux-x64-gnu.node
...@@ -106,14 +106,14 @@ jobs: ...@@ -106,14 +106,14 @@ jobs:
needs: build-native-dev needs: build-native-dev
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
with: with:
fetch-depth: 25 fetch-depth: 25
- run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change') - run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change')
id: docs-change id: docs-change
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }} if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
with: with:
name: next-swc-dev-binary name: next-swc-dev-binary
......
...@@ -9,7 +9,7 @@ jobs: ...@@ -9,7 +9,7 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- run: yarn install --frozen-lockfile --check-files - run: yarn install --frozen-lockfile --check-files
env: env:
...@@ -19,7 +19,7 @@ jobs: ...@@ -19,7 +19,7 @@ jobs:
- run: node run-tests.js --timings --write-timings -g 1/1 - run: node run-tests.js --timings --write-timings -g 1/1
- uses: actions/cache@v2 - uses: actions/cache@v3
id: cache-build id: cache-build
with: with:
path: ./* path: ./*
...@@ -38,7 +38,7 @@ jobs: ...@@ -38,7 +38,7 @@ jobs:
matrix: matrix:
group: [1, 2, 3, 4, 5, 6] group: [1, 2, 3, 4, 5, 6]
steps: steps:
- uses: actions/cache@v2 - uses: actions/cache@v3
id: restore-build id: restore-build
with: with:
path: ./* path: ./*
......
...@@ -9,7 +9,7 @@ jobs: ...@@ -9,7 +9,7 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- run: yarn install --frozen-lockfile --check-files - run: yarn install --frozen-lockfile --check-files
env: env:
...@@ -19,7 +19,7 @@ jobs: ...@@ -19,7 +19,7 @@ jobs:
- run: node run-tests.js --timings --write-timings -g 1/1 - run: node run-tests.js --timings --write-timings -g 1/1
- uses: actions/cache@v2 - uses: actions/cache@v3
id: cache-build id: cache-build
with: with:
path: ./* path: ./*
...@@ -38,7 +38,7 @@ jobs: ...@@ -38,7 +38,7 @@ jobs:
matrix: matrix:
group: [1, 2, 3, 4, 5, 6] group: [1, 2, 3, 4, 5, 6]
steps: steps:
- uses: actions/cache@v2 - uses: actions/cache@v3
id: restore-build id: restore-build
with: with:
path: ./* path: ./*
......
...@@ -78,7 +78,7 @@ cache: ...@@ -78,7 +78,7 @@ cache:
Using GitHub's [actions/cache](https://github.com/actions/cache), add the following step in your workflow file: Using GitHub's [actions/cache](https://github.com/actions/cache), add the following step in your workflow file:
```yaml ```yaml
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
# See here for caching with `yarn` https://github.com/actions/cache/blob/main/examples.md#node---yarn or you can leverage caching with actions/setup-node https://github.com/actions/setup-node # See here for caching with `yarn` https://github.com/actions/cache/blob/main/examples.md#node---yarn or you can leverage caching with actions/setup-node https://github.com/actions/setup-node
path: | path: |
......
...@@ -181,25 +181,5 @@ ...@@ -181,25 +181,5 @@
}, },
"engines": { "engines": {
"node": ">=12.22.0" "node": ">=12.22.0"
},
"turbo": {
"pipeline": {
"build-native": {
"dependsOn": [
"^build-native"
],
"outputs": [
"native/*.node"
]
},
"build-wasm": {
"dependsOn": [
"^build-wasm"
],
"outputs": [
"crates/wasm/pkg/*"
]
}
}
} }
} }
import Link from 'next/link' import Link from 'next/link'
import('lodash').then((_) => console.log(_.chunk(['a', 'b', 'c', 'd'], 2))) import('lodash').then(({ default: _ }) =>
console.log(_.chunk(['a', 'b', 'c', 'd'], 2))
)
const Page = () => { const Page = () => {
return ( return (
......
{
"pipeline": {
"build-native": {
"dependsOn": ["^build-native"],
"outputs": ["native/*.node"]
},
"build-wasm": {
"dependsOn": ["^build-wasm"],
"outputs": ["crates/wasm/pkg/*"]
}
}
}
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