Skip to content

Commit

Permalink
Merge branch 'main' into feat/with-nestjs
Browse files Browse the repository at this point in the history
  • Loading branch information
Neosoulink authored May 21, 2024
2 parents 8ef9b7a + d52a6d2 commit 763f23f
Show file tree
Hide file tree
Showing 541 changed files with 17,668 additions and 13,741 deletions.
12 changes: 11 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,19 @@ rustdocflags = ["-Znormalize-docs"]
[target.x86_64-pc-windows-msvc]
linker = "rust-lld"

[target.aarch64-apple-darwin]
[target.'cfg(target_os = "macos")']
linker = "rust-lld"

[target.'cfg(all(target_os = "linux", target_env = "gnu"))']
rustflags = [
"--cfg",
"tokio_unstable",
"-Zshare-generics=y",
"-Zthreads=8",
"-Csymbol-mangling-version=v0",
"-Clink-arg=-fuse-ld=lld",
]

[alias]
xtask = "run --package xtask --"
tr-build = "build -p turbo"
Expand Down
12 changes: 12 additions & 0 deletions .github/actions/install-global-turbo/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "Install Global Turbo"
description: "Installs turbo globally. Expects Node and npm to already be installed"

runs:
using: "composite"
steps:
- name: Install Turbo globally
shell: bash
run: |
VERSION=$(npm view turbo --json | jq -r '.versions | last')
echo "Latest published version: $VERSION"
npm i -g turbo@$VERSION
13 changes: 9 additions & 4 deletions .github/actions/setup-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ runs:
# we want more specific settings
cache: false

- name: "Install LLD (LLVM Linker) for Linux"
if: runner.os == 'Linux'
shell: bash
run: sudo apt-get -y update && sudo apt-get install -y lld

- name: "Set Windows default host to MinGW"
if: ${{ inputs.windows == 'true' }}
shell: bash
Expand All @@ -42,16 +47,16 @@ runs:
- name: Set Up Protoc
id: set-up-protoc
continue-on-error: true
uses: arduino/setup-protoc@v1.2.0
uses: arduino/setup-protoc@v2.1.0
with:
version: "3.x"
version: "26.x"
repo-token: ${{ inputs.github-token }}

- name: Set Up Protoc (second try)
if: steps.set-up-protoc.outcome == 'failure'
uses: arduino/setup-protoc@v1.2.0
uses: arduino/setup-protoc@v2.1.0
with:
version: "3.x"
version: "26.x"
repo-token: ${{ inputs.github-token }}

- name: "Add cargo problem matchers"
Expand Down
13 changes: 5 additions & 8 deletions .github/actions/setup-turborepo-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ inputs:
github-token:
description: "GitHub token. You can pass secrets.GITHUB_TOKEN"
required: true
node-version:
description: Node version
required: false
default: "18"

runs:
using: "composite"
Expand All @@ -16,7 +20,7 @@ runs:
uses: ./.github/actions/setup-node
with:
extra-flags: --no-optional
node-version: "20"
node-version: ${{ inputs.node-version }}

- name: "Setup Rust"
uses: ./.github/actions/setup-rust
Expand All @@ -29,10 +33,3 @@ runs:

- name: "Setup capnproto"
uses: ./.github/actions/setup-capnproto

- name: Install Turbo globally
shell: bash
run: |
VERSION=$(npm view turbo --json | jq -r '.versions | last')
echo "Latest published version: $VERSION"
npm i -g turbo@$VERSION
7 changes: 6 additions & 1 deletion .github/turbo-orchestrator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ labeler:
isPRAuthorMatch: "^(bgw|ForsakenHarmony|kdy1|kwonoj|padmaia|sokra|wbinnssmith)$"
- label: "created-by: turborepo"
when:
isPRAuthorMatch: "^(gsoltis|anthonyshew|tknickman|mehulkar|chris-olszewski|NicholasLYang|arlyon|Zertsov)$"
isPRAuthorMatch: "^(gsoltis|anthonyshew|tknickman|mehulkar|chris-olszewski|NicholasLYang|arlyon|Zertsov|paulogdm|codybrouwers)$"

# needs: triage when not any of the turbopack or turborepo team
- label: "needs: triage"
when:
isNotPRAuthorMatch: "^(bgw|ForsakenHarmony|kdy1|kwonoj|padmaia|sokra|wbinnssmith|gsoltis|anthonyshew|tknickman|mehulkar|chris-olszewski|NicholasLYang|arlyon|Zertsov|paulogdm|codybrouwers)$"

# areas
- label: "area: ci"
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/bench-turborepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node

- uses: ./.github/actions/setup-turborepo-environment
- name: Setup Turborepo Environment
uses: ./.github/actions/setup-turborepo-environment
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Build
run: cd cli && make turbo-prod
run: pnpm -F cli build:release

- name: Run benchmarks
run: pnpm -F @turbo/benchmark benchmark
Expand Down Expand Up @@ -78,13 +79,14 @@ jobs:
if: ${{ matrix.os.runner == 'windows-latest'}}
run: rustup target add x86_64-pc-windows-gnu

- uses: ./.github/actions/setup-turborepo-environment
- name: Setup Turborepo Environment
uses: ./.github/actions/setup-turborepo-environment
with:
windows: ${{ matrix.os.name == 'windows' }}
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Build Turborepo from source
run: cd cli && make turbo-prod
run: pnpm -F cli build:release

- name: Run benchmarks
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lsp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
fail-fast: false
matrix:
settings:
- host: macos-latest
- host: macos-12
target: "x86_64-apple-darwin"
container-options: "--rm"
- host: macos-latest
- host: macos-12
target: "aarch64-apple-darwin"
container-options: "--rm"
- host: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-turbopack-rust-bench-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
uses: ./.github/actions/setup-rust
with:
save-cache: true
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Setup Node.js
uses: ./.github/actions/setup-node
Expand Down
45 changes: 32 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,15 @@ jobs:
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3

- uses: ./.github/actions/setup-turborepo-environment
- name: Setup Turborepo Environment
uses: ./.github/actions/setup-turborepo-environment
with:
windows: ${{ matrix.os.name == 'windows' }}
windows: ${{ matrix.os.runner == 'windows-latest' }}
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Install Global Turbo
uses: ./.github/actions/install-global-turbo

# We explicitly unset RUSTC_WRAPPER if it is an empty string as causes build issues
- run: |
if [ -z "${RUSTC_WRAPPER}" ]; then
Expand Down Expand Up @@ -269,11 +274,16 @@ jobs:
shell: bash
run: git config --global core.autocrlf input
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-turborepo-environment

- name: Setup Turborepo Environment
uses: ./.github/actions/setup-turborepo-environment
with:
windows: ${{ matrix.os.runner == 'windows-latest' }}
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Install Global Turbo
uses: ./.github/actions/install-global-turbo

- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1
with:
Expand Down Expand Up @@ -308,11 +318,14 @@ jobs:
shell: bash
run: corepack disable

- uses: ./.github/actions/setup-turborepo-environment
- name: Setup Turborepo Environment
uses: ./.github/actions/setup-turborepo-environment
with:
windows: ${{ matrix.os.runner == 'windows-latest' }}
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Install Global Turbo
uses: ./.github/actions/install-global-turbo

- name: Check examples
shell: bash
# Concurrency being 1 is a big hammer here.
Expand Down Expand Up @@ -364,11 +377,14 @@ jobs:
ref: ${{ github.ref }}
fetch-depth: ${{ steps.fetch-depth.outputs.depth }}

- name: Build turborepo CLI from source
- name: Setup Turborepo Environment
uses: ./.github/actions/setup-turborepo-environment
with:
windows: ${{ matrix.os.name == 'windows' }}
github-token: "${{ secrets.GITHUB_TOKEN }}"
node-version: "20"

- name: Install Global Turbo
uses: ./.github/actions/install-global-turbo

- name: Run tests
# We manually set TURBO_API to an empty string to override Hetzner env
Expand Down Expand Up @@ -459,7 +475,6 @@ jobs:
- name: Setup Turborepo Environment
uses: ./.github/actions/setup-turborepo-environment
with:
windows: ${{ matrix.os.name == 'windows' }}
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Run cargo check
Expand All @@ -481,7 +496,6 @@ jobs:
- name: Setup Turborepo Environment
uses: ./.github/actions/setup-turborepo-environment
with:
windows: ${{ matrix.os.name == 'windows' }}
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Run cargo clippy
Expand Down Expand Up @@ -513,6 +527,7 @@ jobs:
uses: ./.github/actions/setup-rust
with:
targets: wasm32-unknown-unknown,wasm32-wasip1-threads
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Run cargo check release
run: |
Expand Down Expand Up @@ -658,7 +673,7 @@ jobs:
- name: Setup Turborepo Environment
uses: ./.github/actions/setup-turborepo-environment
with:
windows: ${{ matrix.os.name == 'windows' }}
windows: ${{ matrix.os.runner == 'windows-latest' }}
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Run tests
Expand Down Expand Up @@ -725,7 +740,7 @@ jobs:
matrix:
os:
- name: macos
runner: macos-latest
runner: macos-12
- name: windows
runner: windows-latest
runs-on: ${{ matrix.os.runner }}
Expand Down Expand Up @@ -818,7 +833,7 @@ jobs:
matrix:
os:
- name: macos
runner: macos-latest
runner: macos-12
# Temporarily disable windows bench due to consistent timeouts
# - name: windows
# runner: windows-2019
Expand Down Expand Up @@ -846,10 +861,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- uses: ./.github/actions/setup-turborepo-environment
- name: Setup Turborepo Environment
uses: ./.github/actions/setup-turborepo-environment
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Install Global Turbo
uses: ./.github/actions/install-global-turbo

- name: Lint
# Filters some workspaces out:
# - Other `@vercel/*` packages because ??
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/turborepo-library-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,30 @@ jobs:
target: "x86_64-unknown-linux-musl"
container: ghcr.io/napi-rs/napi-rs/nodejs-rust:stable-2023-09-17-alpine
install: |
apk update && apk upgrade
apk add libc6-compat curl
echo /root/.cargo/bin >> ${GITHUB_PATH}
echo /usr/local/cargo/bin/rustup >> ${GITHUB_PATH}
setup: |
export PATH=/usr/local/cargo/bin/rustup:/root/.cargo/bin:${PATH}
rustup show active-toolchain
dirname $(rustup which cargo) >> ${GITHUB_PATH}
pnpm install
- host: ubuntu-latest
target: "aarch64-unknown-linux-musl"
container: ghcr.io/napi-rs/napi-rs/nodejs-rust:stable-2023-09-17-alpine
install: |
apk update && apk upgrade
apk add libc6-compat curl
echo /root/.cargo/bin >> ${GITHUB_PATH}
echo /usr/local/cargo/bin/rustup >> ${GITHUB_PATH}
echo /aarch64-linux-musl-cross/bin >> ${GITHUB_PATH}
export PATH=/aarch64-linux-musl-cross/bin:/usr/local/cargo/bin/rustup:/root/.cargo/bin:${PATH}
setup: |
export PATH=/aarch64-linux-musl-cross/bin:/usr/local/cargo/bin/rustup:/root/.cargo/bin:${PATH}
rustup default $(cat ./rust-toolchain)-aarch64-unknown-linux-musl
rustup show active-toolchain
rustup target add aarch64-unknown-linux-musl
rustup toolchain install $(cat ./rust-toolchain)
dirname $(rustup which cargo) >> ${GITHUB_PATH}
pnpm install
rust_env: CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc RUSTFLAGS="-Ctarget-feature=-crt-static"

Expand Down Expand Up @@ -103,7 +109,10 @@ jobs:
if: ${{ matrix.settings.setup }}

- name: Build native library
# For some reason PATH modifications from Setup toolchain aren't populated
# when using the nodejs-rust alpine container.
run: |
export PATH=/usr/local/cargo/bin/rustup:/root/.cargo/bin:${PATH}
cd packages/turbo-repository
${{ matrix.settings.rust_env }} pnpm build:release --target=${{ matrix.settings.target }}
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/turborepo-native-lib-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ jobs:
ref: ${{ github.ref }}
fetch-depth: ${{ steps.fetch-depth.outputs.depth }}

- name: Build turborepo CLI from source
- name: Setup Turborepo Environment
uses: ./.github/actions/setup-turborepo-environment
with:
windows: ${{ matrix.os.name == 'windows' }}
github-token: "${{ secrets.GITHUB_TOKEN }}"
node-version: "20"

- name: Install Global Turbo
uses: ./.github/actions/install-global-turbo

- name: Run tests
# Manually set TURBO_API to an empty string to override Hetzner env
Expand Down
Loading

0 comments on commit 763f23f

Please sign in to comment.