这是indexloc提供的服务,不要输入任何密码
Skip to content

[PR to mk/tests] CI iteration #1961

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 0 additions & 64 deletions .github/actions/setup-deps/action.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Turborepo Go Setup"
description: "Sets Go up for CI"
inputs:
github-token:
description: "GitHub token. You can pass secrets.GITHUB_TOKEN"
required: true
go-version:
description: "Change Go version"
required: false
default: "1.18"
runs:
using: "composite"
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ inputs.go-version }}
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
40 changes: 40 additions & 0 deletions .github/actions/setup-node/action.yml
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
20 changes: 2 additions & 18 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,14 @@ jobs:

steps:
- uses: actions/checkout@v3
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! 😅

with:
fetch-depth: 2

- uses: ./.github/actions/setup-deps
- uses: ./.github/actions/setup-node
- uses: ./.github/actions/setup-go
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
setup-node: false # TODO: does this need to be customized in this workflow?

- uses: pnpm/action-setup@v2.2.2
with:
version: 7.2.1

- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: 16
cache: pnpm

- name: Build
run: cd cli && make turbo

- name: Install dependencies
run: pnpm install --filter=benchmark
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so full pnpm install?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, low cost since it'll come from local cache.


- name: Download previous benchmark results
# continue on error so that we handle the bootstrap case where there is no previous data
continue-on-error: true
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/pr-go-e2e.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: CLI E2E tests

env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -24,10 +21,8 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2

- uses: ./.github/actions/setup-deps
- uses: ./.github/actions/setup-node
- uses: ./.github/actions/setup-go
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/pr-go-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

on:
pull_request:
types: [opened, edited, synchronize]
Expand All @@ -20,13 +17,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-go
with:
fetch-depth: 2

- uses: ./.github/actions/setup-deps
with:
go-version: 1.17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this? as mentioned in #1904 (comment)

github-token: "${{ secrets.GITHUB_TOKEN }}"
setup-node: false

- name: Setup Protos
run: cd cli && make compile-protos
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/pr-go-run-examples.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: CLI Run Examples

env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -34,7 +31,6 @@ jobs:

runs-on: ${{ matrix.os }}
steps:
# TODO: what is this for? The other Go workflows don't need it
- name: Install Sponge
shell: bash
run: |
Expand All @@ -45,19 +41,15 @@ jobs:
fi

- uses: actions/checkout@v3
with:
fetch-depth: 2

- uses: ./.github/actions/setup-deps
- uses: ./.github/actions/setup-go
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
setup-node: false # TODO: Does this need to be customized in this workflow?

- uses: pnpm/action-setup@v2.2.2
with:
version: 7.2.1

# TODO: Is this necessary? The other Go jobs don't include this
- name: Make sure pnpm always has a cache
shell: bash
run: |
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/pr-go-unit.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: CLI Unit Tests

env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -24,10 +21,8 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2

- uses: ./.github/actions/setup-deps
- uses: ./.github/actions/setup-node
- uses: ./.github/actions/setup-go
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/pr-js-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

on:
push:
branches: ["main"]
Expand All @@ -28,10 +25,8 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2

- uses: ./.github/actions/setup-deps
- uses: ./.github/actions/setup-node
- uses: ./.github/actions/setup-go
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/pr-js-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

on:
push:
branches: ["main"]
Expand All @@ -28,10 +25,8 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2

- uses: ./.github/actions/setup-deps
- uses: ./.github/actions/setup-node
- uses: ./.github/actions/setup-go
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

Expand Down
22 changes: 4 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
token: ${{ secrets.TURBOBOT }}

- uses: ./.github/actions/setup-deps
- uses: ./.github/actions/setup-node
with:
enable-corepack: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. This was one of the reasons to split up Node and Go for me too!

- uses: ./.github/actions/setup-go
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
setup-node: false # TODO: does this need to be customized? (corepack step is omitted here)

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
Expand All @@ -54,20 +54,6 @@ jobs:
# We ignore the output of this run, instead using it just to install the binary.
args: --issues-exit-code=0

- uses: pnpm/action-setup@v2.2.2
with:
version: 7.2.1

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
cache: pnpm

- name: Install dependencies
run: pnpm install --filter=turbo-monorepo

- name: Configure git
run: |
git config --global user.name 'Turbobot'
Expand Down