Skip to content

Commit

Permalink
feature(turborepo): Port rest of CLI (vercel#2733)
Browse files Browse the repository at this point in the history
* Created two separate chains for executing commands: One that uses the parsed arguments from clap that are
serialized to json, the other that still uses Cobra. Now to test to ensure that both do the same thing

* Adjusted json serialization. Now debugging

* Hooked up new CLI to commands

* Fixing compile error

* fixing lint error

* Fixing more Go lint errors

* Fixing lint errors

* fixing up tests

* Only using turbo state with link, login, and logout commands

* Reverting changes

* Removing more changes

* Deleting code and fixing lints

* Removed unlink command

* Fixing bugs

* Reverting more changes

* fixed all tests

* Refactored away duplicates using CLIConfigProvider interface

* Lint fixes

* Minor order tweak

* Added error if command is not handled

* PR feedback

* Minor fixes. Adding --__test-run flag

* Added workaround for subcommand help

* Moved logic around to accomodate login/logout/link/unlink

* Added some documentation, removed some printf

* Adding more tests.

* Hooked up link/login/unlink to --__test-run flag. Also added prysk tests for it.

* Split up derive into multiple lines

* Added comment explaining clap v3 in Cargo.toml

* Ported daemon

* Cleaning up code. Removed imports

* Fix lints

* Fixing lints

* Ported prune to Rust CLI

* Going all the way. Porting run to Rust CLI and upgrading back to clap v4

* Always gotta be testing

* Always be testing. Always. Be. Testing.

* Added tests for each singular flag. Now for combination tests

* WIP: Hooking up Rust CLI to Go run logic

* Disable color

* Removed root inference from Go side

* Fixing compile errors

* Update cli/cmd/turbo/main.go

Co-authored-by: Chris Olszewski <[email protected]>

* Patching up code for run

* PR changes

* Restored labeler

* Restore og.tsx

* Reverted run changes that somehow made it in here

* Fix run

* Update cli/internal/turbostate/turbostate.go

Co-authored-by: Chris Olszewski <[email protected]>

* feat: polyfill `global` with `globalThis` (vercel#2666)

This PR changes the ecmascript chunk logic to polyfill `global` with `globalThis`. A more complex and less performant solution (but with the benefit of us knowing the runtime environment) would be to add an effect for simple identifier expressions.

* delete IsYarn util (vercel#2668)

* feat(docs): new authors & consistent filesnames (vercel#2680)

* Added caveat to environment variables docs (vercel#2703)

Co-authored-by: Thomas Knickman <[email protected]>

* Fix publish workflow (vercel#2681)

* change from yarn to pnpm (vercel#2686)

Co-authored-by: Justin Ridgewell <[email protected]>

* Reverted workflow changes

* Fixing tests. Added run args to base

* Trying to fix tests

* Rewrote some logic around run args handling

* Fixing up tests by adding flags and fixing parsing bugs

* Hooked up RepoState to Go code

* Fixing e2e tests

* Fixing e2e

* Gotta build shim, not turbo in package.json

* Patched integration test

* Reverted Cargo.toml

* Cargo.lock too

* Fixing tests

* Moving turbo binary to shim

* Fixed tests and CI

* Check for TURBO_BINARY_PATH

* Ported shell completions to Rust

* Fixed logic issue with TURBO_BINARY_PATH

* Created .gitignore file with generated rust and header files

* Second try on cleaning up generated files

* More CI fixes

* Realized we still need some inference

* Removed files that are edited by run-examples.sh

* Switched order of `cargo fmt --check` and `cargo clippy` because `cargo clippy` generates files needed for `cargo fmt --check`.

* Cleaning up changes.

* Fix one thing break another

* Accept integration changes

* Deleting more unused code

* Test fixes

* No longer need this line now that src/ffi.rs is gitignored

* PR feedback

* Update cli/internal/run/run.go

Co-authored-by: Chris Olszewski <[email protected]>

* Fixing typo

* Merged main

* PR feedback

* PR feedback

* Merge main

* Reverted workflow change

* add build turbo GH action to use across workflows

* use correct build target

* Error on invalid unicode instead of lossy conversion

* PR feedback

* Squashed commit of the following:

commit 096b8b8
Author: David Barrat <[email protected]>
Date:   Mon Dec 5 15:29:41 2022 +0100

    Docs: Add Authdog to Turbo Showcase page (vercel#2921)

    [Authdog](https://www.authdog.com/)  is an Identity and Access Management as a Service platform, built upon Serverless technologies (AWS Lambda, Vercel, Fastly and Cloudflare Workers). I started looking for alternatives to Nx, some times ago and experimented with Turbo, decided to migrate some projects to this tool, awesome stuff!

commit e39d65e
Author: Tobias Koppers <[email protected]>
Date:   Mon Dec 5 15:23:40 2022 +0100

    enable id reusing (vercel#2895)

    Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

commit 6b99818
Author: Tobias Koppers <[email protected]>
Date:   Mon Dec 5 15:22:53 2022 +0100

    Reduce wrapper tasks by eagerly resolving Vcs (vercel#2933)

    * resolve codegenerateable before calling it

    * eagerly resolve some constructors to avoid creating many wrapper tasks

    Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

commit ce4c445
Author: Tobias Koppers <[email protected]>
Date:   Mon Dec 5 15:22:32 2022 +0100

    Share TaskInputs between task cache and task (vercel#2923)

    Move bound task function into TaskState to allow unloading

    Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

commit e1bf5e2
Author: Tobias Koppers <[email protected]>
Date:   Mon Dec 5 14:32:24 2022 +0100

    make sure that removing collectibles will cleanup helper entries (vercel#2872)

commit 532eff7
Author: Tobias Koppers <[email protected]>
Date:   Mon Dec 5 13:27:22 2022 +0100

    Reduce the number of Strings and wrapper tasks (vercel#2834)

    * use Cow to avoid creating Strings for trait function names
    * trait calls avoid the resolve trait wrapper task when called on a resolved VC
    * eagerly resolve some Vc that would otherwise create a lot of wrapper tasks

    Depends on vercel#2416

commit dc36fc4
Author: Tobias Koppers <[email protected]>
Date:   Mon Dec 5 11:00:10 2022 +0100

    reduce number of allocations (vercel#2833)

    VecDeque::new always allocates 7 elements

commit 4f247be
Author: Nathan Hammond <[email protected]>
Date:   Mon Dec 5 15:39:15 2022 +0800

    Upgrade to Next.js 13 (vercel#2906)

    This gets our site updated to Next.js 13 and Nextra 2. As a bonus, this should help prevent some of the issues we're seeing in Sentry.

commit 1e81806
Author: Tobias Koppers <[email protected]>
Date:   Mon Dec 5 07:42:19 2022 +0100

    shrink lists and sets that are stored in Tasks (vercel#2873)

    Reduces memory usage by 14%

commit cac79bb
Author: Ahab <[email protected]>
Date:   Sun Dec 4 13:23:26 2022 +0800

    make lazy bundling for dynamic import more lazy (vercel#2918)

    For example:

    ```js
    // index.js
    setTimeout(() => {
      import('./async.js').then(() => console.log('async.js loaded'))
    }, 1000)
    ```

    ```js
    // async.js
    import './async.css';
    console.log('async.js content')
    ```

    For now the graph generated by above code will be like this:

    <img width="1461" alt="Screen Shot 2022-12-03 at 21 22 24" src="https://user-images.githubusercontent.com/42857895/205442932-ebfd5126-ef3d-4205-b5b5-434126ad46f7.png">

    The `ChunkGroup_async` will be a async chunk group of `ChunkGroup_index`, pushed at [turbopack-core/src/chunk/mod.rs#L462](https://github.com/vercel/turbo/blob/b7bcfc312e41367e2ec7f5fb37a6ee88a6b6545a/crates/turbopack-core/src/chunk/mod.rs#L462), and it will have a reference between `ChunkGroup_index` and `ChunkGroup_async`, but `ChunkGroup_async` will also be a chunk group of `ChunkGroup_async-manifest-chunk` created at [turbopack-ecmascript/src/chunk/loader.rs#L165](https://github.com/vercel/turbo/blob/b7bcfc312e41367e2ec7f5fb37a6ee88a6b6545a/crates/turbopack-ecmascript/src/chunk/loader.rs#L165), and will have a reference between `ChunkGroup_async-manifest-chunk` and `ChunkGroup_async`.

    This leads to when the browser request '/_a8a837.js', turbopack will compile chunks in `ChunkGroup_index` ('/_a8a837.js'), `ChunkGroup_async-manifest-chunk` ('/src_async.js_manifest-chunk.js'), and also chunks in `ChunkGroup_async` ('/src_async.js', '/src_async.css'), because of the reference between `ChunkGroup_index` and `ChunkGroup_async`.

    But the expected behavior is only compile chunks in `ChunkGroup_index` and `ChunkGroup_async-manifest-chunk`, so this PR deleted the reference between `ChunkGroup_index` and `ChunkGroup_async`, makes the graph be like this:

    <img width="1461" alt="Screen Shot 2022-12-03 at 21 50 29" src="https://user-images.githubusercontent.com/42857895/205444165-7b266dce-9aa6-4829-b8dc-d2bf74642aff.png">

    And makes chunks in `ChunkGroup_async` to be compiled only when the browser request '/src_async.js_manifest-chunk.js'.

commit fd09f2e
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Sun Dec 4 03:26:37 2022 +0000

    chore(deps): update dependency @types/node to v18.11.10 (vercel#2928)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    Co-authored-by: Thomas Knickman <[email protected]>

commit 429e91e
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Sat Dec 3 22:21:26 2022 -0500

    chore(deps): update dependency @babel/core to v7.20.5 (vercel#2919)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

commit 6478d61
Author: Tobias Koppers <[email protected]>
Date:   Sat Dec 3 22:11:10 2022 +0100

    update chromiumoxide (vercel#2916)

    updating in hope that this fixes the random errors in test runs

commit b7bcfc3
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Sat Dec 3 08:54:50 2022 +0000

    chore(deps): update rust crate futures to 0.3.25 (vercel#2915)

    [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

    This PR contains the following updates:

    | Package | Type | Update | Change |
    |---|---|---|---|
    | [futures](https://rust-lang.github.io/futures-rs) ([source](https://togithub.com/rust-lang/futures-rs)) | dev-dependencies | patch | `0.3.21` -> `0.3.25` |
    | [futures](https://rust-lang.github.io/futures-rs) ([source](https://togithub.com/rust-lang/futures-rs)) | dependencies | patch | `0.3.21` -> `0.3.25` |
    | [futures](https://rust-lang.github.io/futures-rs) ([source](https://togithub.com/rust-lang/futures-rs)) | dependencies | patch | `0.3.24` -> `0.3.25` |

    ---

    ### ⚠ Dependency Lookup Warnings ⚠

    Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information.

    ---

    ### Release Notes

    <details>
    <summary>rust-lang/futures-rs</summary>

    ### [`v0.3.25`](https://togithub.com/rust-lang/futures-rs/blob/HEAD/CHANGELOG.md#&#8203;0325---2022-10-20)

    [Compare Source](https://togithub.com/rust-lang/futures-rs/compare/0.3.24...0.3.25)

    -   Fix soundness issue in `join!` and `try_join!` macros ([#&vercel#8203;2649](https://togithub.com/rust-lang/futures-rs/issues/2649))
    -   Implement `Clone` for `sink::Drain` ([#&vercel#8203;2650](https://togithub.com/rust-lang/futures-rs/issues/2650))

    ### [`v0.3.24`](https://togithub.com/rust-lang/futures-rs/blob/HEAD/CHANGELOG.md#&#8203;0324---2022-08-29)

    [Compare Source](https://togithub.com/rust-lang/futures-rs/compare/0.3.23...0.3.24)

    -   Fix incorrect termination of `select_with_strategy` streams ([#&vercel#8203;2635](https://togithub.com/rust-lang/futures-rs/issues/2635))

    ### [`v0.3.23`](https://togithub.com/rust-lang/futures-rs/blob/HEAD/CHANGELOG.md#&#8203;0323---2022-08-14)

    [Compare Source](https://togithub.com/rust-lang/futures-rs/compare/0.3.22...0.3.23)

    -   Work around MSRV increase due to a cargo bug.

    ### [`v0.3.22`](https://togithub.com/rust-lang/futures-rs/blob/HEAD/CHANGELOG.md#&#8203;0322---2022-08-14)

    [Compare Source](https://togithub.com/rust-lang/futures-rs/compare/0.3.21...0.3.22)

    -   Fix `Sync` impl of `BiLockGuard` ([#&vercel#8203;2570](https://togithub.com/rust-lang/futures-rs/issues/2570))
    -   Fix partial iteration in `FuturesUnordered` ([#&vercel#8203;2574](https://togithub.com/rust-lang/futures-rs/issues/2574))
    -   Fix false detection of inner panics in `Shared` ([#&vercel#8203;2576](https://togithub.com/rust-lang/futures-rs/issues/2576))
    -   Add `Mutex::lock_owned` and `Mutex::try_lock_owned` ([#&vercel#8203;2571](https://togithub.com/rust-lang/futures-rs/issues/2571))
    -   Add `io::copy_buf_abortable` ([#&vercel#8203;2507](https://togithub.com/rust-lang/futures-rs/issues/2507))
    -   Remove `Unpin` bound from `TryStreamExt::into_async_read` ([#&vercel#8203;2599](https://togithub.com/rust-lang/futures-rs/issues/2599))
    -   Make `run_until_stalled` handle self-waking futures ([#&vercel#8203;2593](https://togithub.com/rust-lang/futures-rs/issues/2593))
    -   Use `FuturesOrdered` in `try_join_all` ([#&vercel#8203;2556](https://togithub.com/rust-lang/futures-rs/issues/2556))
    -   Fix orderings in `LocalPool` waker ([#&vercel#8203;2608](https://togithub.com/rust-lang/futures-rs/issues/2608))
    -   Fix `stream::Chunk` adapters size hints ([#&vercel#8203;2611](https://togithub.com/rust-lang/futures-rs/issues/2611))
    -   Add `push_front` and `push_back` to `FuturesOrdered` ([#&vercel#8203;2591](https://togithub.com/rust-lang/futures-rs/issues/2591))
    -   Deprecate `FuturesOrdered::push` in favor of `FuturesOrdered::push_back` ([#&vercel#8203;2591](https://togithub.com/rust-lang/futures-rs/issues/2591))
    -   Performance improvements ([#&vercel#8203;2583](https://togithub.com/rust-lang/futures-rs/issues/2583), [#&vercel#8203;2626](https://togithub.com/rust-lang/futures-rs/issues/2626))
    -   Documentation improvements ([#&vercel#8203;2579](https://togithub.com/rust-lang/futures-rs/issues/2579), [#&vercel#8203;2604](https://togithub.com/rust-lang/futures-rs/issues/2604), [#&vercel#8203;2613](https://togithub.com/rust-lang/futures-rs/issues/2613))

    </details>

    ---

    ### Configuration

    📅 **Schedule**: Branch creation - "after 10pm every weekday,before 5am every weekday,every weekend" (UTC), Automerge - At any time (no schedule defined).

    🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

    ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

    ---

     - [ ] If you want to rebase/retry this PR, check this box

    ---

    This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/vercel/turbo).

commit 93222f2
Author: Anthony Shew <[email protected]>
Date:   Fri Dec 2 16:36:55 2022 -0800

    feat(docs): document topology outside of a task (vercel#2879)

    * Docs for topology outside of a task

    Documentation for behavior in vercel#2855!

    * Minor cleanup.

    * Some copy updates and add image.

    Co-authored-by: Thomas Knickman <[email protected]>

commit f8aaf81
Author: Will Binns-Smith <[email protected]>
Date:   Fri Dec 2 16:32:35 2022 -0800

    Link to Turbopack's architecture.md from CONTRIBUTING.md (vercel#2913)

commit 0723170
Author: Thomas Knickman <[email protected]>
Date:   Fri Dec 2 16:40:08 2022 -0500

    feat(docs): add github (vercel#2912)

commit c69298c
Author: OJ Kwon <[email protected]>
Date:   Fri Dec 2 11:58:55 2022 -0800

    build(cargo): update swc_core, dependencies to resolve circular deps (vercel#2869)

    * build(cargo): bump up swc_core

    * build(cargo): unpin indexmap

    * build(cargo): update dependencies

    * style(cargo): adjust format

commit 6965cb8
Author: Leah <[email protected]>
Date:   Fri Dec 2 19:42:05 2022 +0100

    set correct cwd for server renderer (vercel#2886)

commit 4a3cb94
Author: Leah <[email protected]>
Date:   Fri Dec 2 18:27:02 2022 +0100

    fix dynamic paths (vercel#2884)

commit eead906
Author: Nathan Hammond <[email protected]>
Date:   Fri Dec 2 16:09:08 2022 +0800

    Fix the missing links. (vercel#2707)

    This PR does three things:
    1. Prevents double redirects by setting the correct destination the first time.
    2. Redirects URLs accidentally recreated in the new scope. 🤦‍♂️
    3. Removes a catch-all to trigger any additional missing links to appear.

    Changes are easy to review commit-by-commit.

commit b8c0c3c
Author: Nathan Hammond <[email protected]>
Date:   Fri Dec 2 14:37:03 2022 +0800

    Update lint-staged behavior. (vercel#2904)

    Before vercel#2859:
    `eslint --quiet --fix`

    After vercel#2859:
    `pnpm run lint --quiet --fix --`
    =>
    `eslint . --ext js,jsx,ts,tsx --quiet --fix --`

    After this:
    `eslint --ext js,jsx,ts,tsx --quiet --fix --`

    Removes the sneaky `.`.

commit 336ea22
Author: Nathan Hammond <[email protected]>
Date:   Fri Dec 2 08:33:21 2022 +0800

    Add additional detailed warning message if no tasks were run. (vercel#2778)

    This is a quality of life improvement output log so that you don't have to tease it out from the overall run summary and the situation is more-apparent.

commit 9359c46
Author: Leah <[email protected]>
Date:   Thu Dec 1 21:02:33 2022 +0100

    simplify `next-binding` (vercel#2899)

commit 22c1440
Author: Justin Ridgewell <[email protected]>
Date:   Thu Dec 1 13:55:15 2022 -0500

    Implement import.meta (vercel#2816)

    I chose to have the `import.meta.url` to have the relative project path on disk.

    Webpack makes it the absolute system path, but that would make the JS output system dependent and I didn't like that. Vite doesn't bundle and uses the browser's behavior, which is the dev server path.

    I'm splitting this from the in-progress PR to implement `new URL(…, import.meta.url)` support. That requires a bunch of changes to the analysis code and a new FS content source, so it's taking longer to ship.

    Fixes WEB-137.

commit 75a7d1e
Author: Thomas Knickman <[email protected]>
Date:   Thu Dec 1 11:40:15 2022 -0500

    fix(examples): cra pnpm fix (vercel#2897)

* Merged main

* Reverting changes that snuck in

* Fixing tests

* Final fixes for tests

* bump timeout on jobs that need to build turborepo

* use prebuilt turbo for e2e tests

* change when turbo is built

* add turbo_tasks State (vercel#2935)

add mark_stateful() method to make tasks with state

* @next/font [1/n] Add query structure to module requests (vercel#2743)

* Add query structure to module requests

* Update crates/next-dev/src/lib.rs

Co-authored-by: Justin Ridgewell <[email protected]>

Co-authored-by: Justin Ridgewell <[email protected]>

* add memory usage tracking (vercel#2865)

* @next/font [2/n] Apply next/font swc transform  (vercel#2742)

* Check in next-font transform from Next.js repo

* Use next-font transform

* Run transform via custom rule

* Place next/font transform behind cargo feature

* Remove unused dependencies (vercel#2934)

* Remove unused dependencies

* Add back lazy static as a dev dep

* Add back bench dependencies

* skip enabling corepack when building turborepo

* Disabled corepack on other node setup action

* explicitly disable corepack for examples

* nvm

* bump timemout for go unit

* I am once again trying to get CI to work

* force gnu compiler on windows

* fix shim build script

* fix lockfile

* use gcc on windows instead of clang

* fix shim

* first pass at splitting out shim to library crate

* change rust test workflow to not run turbo tests

* replace module tests with integration tests

* add readme and docs

* normalize paths in integration test

* Update crates/turborepo-lib/README.md

Co-authored-by: Nicholas Yang <[email protected]>

* Fix Cargo.lock

* fix clippy warnings

* extend timeout for running examples

* Set installed toolchain as default

Co-authored-by: Chris Olszewski <[email protected]>
Co-authored-by: Florentin / 珞辰 <[email protected]>
Co-authored-by: Chris Olszewski <[email protected]>
Co-authored-by: Thomas Knickman <[email protected]>
Co-authored-by: Matt Pocock <[email protected]>
Co-authored-by: Mehul Kar <[email protected]>
Co-authored-by: Yota Hada <[email protected]>
Co-authored-by: Justin Ridgewell <[email protected]>
Co-authored-by: Tobias Koppers <[email protected]>
Co-authored-by: Will Binns-Smith <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
12 people authored Dec 8, 2022
1 parent b5975df commit 283e404
Show file tree
Hide file tree
Showing 63 changed files with 7,597 additions and 2,898 deletions.
43 changes: 43 additions & 0 deletions .github/actions/build-debug-turborepo/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "Turborepo Build Debug"
description: "Builds debug version of turborepo"
inputs:
target:
description: "Compilation target"
required: true
github-token:
description: "GitHub token. You can pass secrets.GITHUB_TOKEN"
required: true
runs:
using: "composite"
steps:
- name: "Setup Node"
uses: ./.github/actions/setup-node
- name: "Setup Go"
uses: ./.github/actions/setup-go
with:
github-token: ${{ inputs.github-token }}
- name: "Setup Rust toolchain"
uses: actions-rs/toolchain@v1
if: ${{ inputs.target != 'windows' }}
- name: "Set Windows default host to MingW"
if: ${{ inputs.target == 'windows' }}
shell: bash
run: rustup set default-host x86_64-pc-windows-gnu && rustup show
- name: "Setup Rust Cache"
uses: Swatinem/rust-cache@v2
with:
key: debug-${{ inputs.target }}
- name: Build Turborepo
shell: bash
run: |
cd cli
make turbo
cd ..
- name: Strip Turborepo binary
shell: bash
run: strip target/debug/turbo.exe
if: ${{ inputs.target == 'windows' }}
- name: Strip Turborepo binary
shell: bash
run: strip target/debug/turbo
if: ${{ inputs.target != 'windows' }}
2 changes: 1 addition & 1 deletion .github/workflows/build_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ jobs:
path: cli/dist-windows-amd64

- name: Perform Release
run: cd cli && make publish-shim
run: cd cli && make publish-turbo
env:
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
19 changes: 13 additions & 6 deletions .github/workflows/pr-go-e2e-filtered.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,26 @@ on:

jobs:
test:
timeout-minutes: 15
runs-on: ${{ matrix.os }}
timeout-minutes: 30
runs-on: ${{ matrix.os.runner }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os:
- name: ubuntu
runner: ubuntu-latest
- name: macos
runner: macos-latest
- name: windows
runner: windows-latest

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/build-debug-turborepo
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
target: ${{ matrix.os.name }}

- name: E2E Tests
run: pnpm -- turbo run e2e --filter=cli
# Turbo has already been built in previous step, no need to rebuild
run: pnpm -- turbo-prebuilt run e2e-prebuilt --filter=cli
20 changes: 7 additions & 13 deletions .github/workflows/pr-go-integration-filtered.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,21 @@ on:

jobs:
test:
timeout-minutes: 15
runs-on: ${{ matrix.os }}
timeout-minutes: 30
runs-on: ${{ matrix.os.runner }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
os:
- name: ubuntu
runner: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/build-debug-turborepo
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Setup rust
uses: actions-rs/toolchain@v1

- name: Setup rust cache
uses: Swatinem/rust-cache@v2
with:
key: test
target: ${{ matrix.os.name }}

- name: Cache Prysk
id: cache-prysk
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/pr-js-tests-filtered.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,26 @@ on:
jobs:
test:
timeout-minutes: 30
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os.runner }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
os:
- name: ubuntu
runner: ubuntu-latest
- name: macos
runner: macos-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/build-debug-turborepo
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
target: ${{ matrix.os.name }}
- name: checkout
# We want to fetch all of the commits in PR and the commit it's based on
# If this isn't a PR, then this is a push and we check against the previous commit
Expand All @@ -41,10 +49,6 @@ jobs:
else
git fetch --no-tags --prune --progress --depth=2
fi
- uses: ./.github/actions/setup-node
- uses: ./.github/actions/setup-go
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
# Note this runs nothing on push since event is push and not pull_request and ...[] matches nothing?
# For push we should just do ..[HEAD^]
Expand Down
86 changes: 54 additions & 32 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,24 @@ jobs:
name: Go Unit Tests
needs: determine_jobs
if: needs.determine_jobs.outputs.go == 'true'
timeout-minutes: 15
runs-on: ${{ matrix.os }}
timeout-minutes: 30
runs-on: ${{ matrix.os.runner }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os:
- name: ubuntu
runner: ubuntu-latest
- name: macos
runner: macos-latest
- name: windows
runner: windows-latest

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/build-debug-turborepo
with:
target: ${{ matrix.os.name }}
github-token: "${{ secrets.GITHUB_TOKEN }}"

- run: pnpm -- turbo run test --filter=cli --color
Expand All @@ -187,35 +193,51 @@ jobs:
name: Go Cli Examples
needs: determine_jobs
if: needs.determine_jobs.outputs.examples == 'true'
timeout-minutes: 15
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
os:
- name: ubuntu
runner: ubuntu-latest
- name: macos
runner: macos-latest
manager: [yarn, npm]
example: [with-yarn, with-npm, non-monorepo]
include:
- os: ubuntu-latest
- os:
name: ubuntu
runner: ubuntu-latest
manager: pnpm
example: basic
- os: macos-latest
- os:
name: macos
runner: macos-latest
manager: pnpm
example: basic
- os: ubuntu-latest
- os:
name: ubuntu
runner: ubuntu-latest
manager: pnpm
example: kitchen-sink
- os: macos-latest
- os:
name: macos
runner: macos-latest
manager: pnpm
example: kitchen-sink
- os: ubuntu-latest
- os:
name: ubuntu
runner: ubuntu-latest
manager: pnpm
example: with-svelte
- os: macos-latest
- os:
name: macos
runner: macos-latest
manager: pnpm
example: with-svelte

runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os.runner }}
steps:
# Used by scripts/check-examples.sh
- name: Install Sponge
Expand All @@ -230,9 +252,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Go
uses: ./.github/actions/setup-go
- name: Build Turborepo
uses: ./.github/actions/build-debug-turborepo
with:
target: ${{ matrix.os.name }}
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Setup Pnpm
Expand All @@ -245,6 +268,10 @@ jobs:
run: |
mkdir -p `pnpm store path`
- name: Disable corepack
shell: bash
run: corepack disable

- name: Setup Node.js
uses: actions/setup-node@v2
with:
Expand Down Expand Up @@ -325,18 +352,18 @@ jobs:
- name: Install cargo rustfmt
run: rustup component add rustfmt

- name: Run cargo fmt check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace --all-targets

- name: Run cargo fmt check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --check

- name: Count clippy warnings
run: |
count="0"
Expand Down Expand Up @@ -432,11 +459,6 @@ jobs:
- name: Setup Rust
uses: actions-rs/toolchain@v1

- name: Setup Go
uses: ./.github/actions/setup-go
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Setup Node.js
uses: ./.github/actions/setup-node

Expand All @@ -456,7 +478,6 @@ jobs:
- name: Prepare toolchain on Windows
run: |
pnpx node-gyp install
choco install protoc -y
echo 'node-linker = "hoisted"' > crates/turbopack/tests/node-file-trace/.npmrc
if: matrix.os.name == 'windows'

Expand Down Expand Up @@ -484,7 +505,8 @@ jobs:
timeout-minutes: 120
with:
command: nextest
args: run --workspace --release --no-fail-fast
# We exclude turbo as it requires linking Go and all logic resides in turborepo-lib
args: run --workspace --release --no-fail-fast --exclude turbo

rust_test_bench:
needs: [determine_jobs, rust_prepare]
Expand Down Expand Up @@ -579,6 +601,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
target: ${{ matrix.os.target }}
default: true

- name: Install musl tools
run: |
Expand Down Expand Up @@ -895,10 +918,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- uses: ./.github/actions/setup-node

- uses: ./.github/actions/setup-go
- uses: ./.github/actions/build-debug-turborepo
with:
target: ubuntu
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Format check
Expand Down
Loading

0 comments on commit 283e404

Please sign in to comment.