-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes the CI setup to: - Extract Go and node setup to a "composite" action, allowing us to setup all CI jobs consistently. For example, the golangci-lint was building turbo with Go 1.17, while the Go unit and e2e tests were building with Go 1.18. - Parallelize some jobs for faster feedback Separates Go unit and e2e tests, and JS lint and tests into separate workflows. The tradeoff is that each Github Action runner will need to install Go and Node and build turbo multiple times, but this is fairly fast, and these steps are highly cacheable. - Improve the names of Workflows, Jobs, and Steps to be more debuggable Some of the naming changes are for consistency, but some make it easier to scan the list of PR checks and the Action summaries to see what failed and where. In some cases, the names of Steps are removed, as the command itself is descriptive enough, that we do not need to name it. Co-authored-by: Nathan Hammond <nathan.hammond@vercel.com>
- Loading branch information
1 parent
651abfc
commit 231fcf9
Showing
12 changed files
with
279 additions
and
341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: "Turborepo Go Setup" | ||
description: "Sets Go up for CI" | ||
inputs: | ||
github-token: | ||
description: "GitHub token. You can pass secrets.GITHUB_TOKEN" | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
cache: true | ||
cache-dependency-path: cli/go.sum | ||
|
||
- name: Set Up Protoc | ||
uses: arduino/setup-protoc@v1 | ||
with: | ||
version: "3.x" | ||
repo-token: ${{ inputs.github-token }} | ||
|
||
- name: Set Up GRPC protobuf | ||
shell: bash | ||
run: | | ||
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.0 | ||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: "Turborepo Node.js Setup" | ||
description: "Sets Node.js up for CI" | ||
inputs: | ||
enable-corepack: | ||
description: "Control turning on corepack." | ||
required: false | ||
default: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2.2.2 | ||
with: | ||
version: 7.2.1 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
cache: pnpm | ||
|
||
- name: Configure corepack | ||
# Forcibly upgrade our available version of corepack. | ||
# The bundled version in node 16 has known issues. | ||
# Prepends the npm bin dir so that it is always first. | ||
shell: bash | ||
run: | | ||
npm install --force --global corepack@latest | ||
npm config get prefix >> $GITHUB_PATH | ||
corepack enable | ||
- name: Enable corepack | ||
if: ${{ inputs.enable-corepack == 'true' }} | ||
shell: bash | ||
run: | | ||
corepack enable | ||
- name: pnpm install | ||
shell: bash | ||
run: pnpm install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: CLI E2E tests | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
types: [opened, edited, synchronize] | ||
|
||
jobs: | ||
test: | ||
timeout-minutes: 15 | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/setup-node | ||
- uses: ./.github/actions/setup-go | ||
with: | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
- name: E2E Tests | ||
run: pnpm -- turbo run e2e --filter=cli | ||
|
Oops, something went wrong.