From b14d67eead7eccd42a57d7deccbebb44a98bf241 Mon Sep 17 00:00:00 2001 From: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com> Date: Fri, 18 Jun 2021 11:23:39 -0700 Subject: [PATCH] Parallelize PR check stages (#824) Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com> --- .github/workflows/compiles.yml | 34 ++++++++++++++++++++++++++++++ .github/workflows/crosscompile.yml | 34 ++++++++++++++++++++++++++++++ .github/workflows/go-test-pkg.yml | 34 ++++++++++++++++++++++++++++++ .github/workflows/go.yml | 5 +---- .github/workflows/lint.yml | 34 ++++++++++++++++++++++++++++++ Makefile | 2 ++ 6 files changed, 139 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/compiles.yml create mode 100644 .github/workflows/crosscompile.yml create mode 100644 .github/workflows/go-test-pkg.yml create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/compiles.yml b/.github/workflows/compiles.yml new file mode 100644 index 000000000..66ab7913f --- /dev/null +++ b/.github/workflows/compiles.yml @@ -0,0 +1,34 @@ +name: Go + +on: + pull_request: + branches: + - master + push: + branches: + - master + +jobs: + build: + name: Compiles on Go ${{ matrix.go-version }} and ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + go-version: [1.16.x] + os: [ubuntu-latest] + steps: + - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build on ${{ matrix.os }} + env: + GO111MODULE: on + GOOS: linux + run: | + make console diff --git a/.github/workflows/crosscompile.yml b/.github/workflows/crosscompile.yml new file mode 100644 index 000000000..507460b87 --- /dev/null +++ b/.github/workflows/crosscompile.yml @@ -0,0 +1,34 @@ +name: Go + +on: + pull_request: + branches: + - master + push: + branches: + - master + +jobs: + build: + name: Cross compile + runs-on: ${{ matrix.os }} + strategy: + matrix: + go-version: [1.16.x] + os: [ubuntu-latest] + steps: + - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build on ${{ matrix.os }} + env: + GO111MODULE: on + GOOS: linux + run: | + make crosscompile diff --git a/.github/workflows/go-test-pkg.yml b/.github/workflows/go-test-pkg.yml new file mode 100644 index 000000000..38d38f4f5 --- /dev/null +++ b/.github/workflows/go-test-pkg.yml @@ -0,0 +1,34 @@ +name: Go + +on: + pull_request: + branches: + - master + push: + branches: + - master + +jobs: + build: + name: Test Pkg on Go ${{ matrix.go-version }} and ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + go-version: [1.16.x] + os: [ubuntu-latest] + steps: + - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build on ${{ matrix.os }} + env: + GO111MODULE: on + GOOS: linux + run: | + make test-pkg diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 69ebf7b1b..77a94d00f 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -10,7 +10,7 @@ on: jobs: build: - name: Test on Go ${{ matrix.go-version }} and ${{ matrix.os }} + name: Test Restapi on Go ${{ matrix.go-version }} and ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: @@ -31,7 +31,4 @@ jobs: GO111MODULE: on GOOS: linux run: | - make verifiers make test - make crosscompile - make console diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..436060d1b --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,34 @@ +name: Go + +on: + pull_request: + branches: + - master + push: + branches: + - master + +jobs: + build: + name: Checking Lint + runs-on: ${{ matrix.os }} + strategy: + matrix: + go-version: [1.16.x] + os: [ubuntu-latest] + steps: + - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build on ${{ matrix.os }} + env: + GO111MODULE: on + GOOS: linux + run: | + make verifiers diff --git a/Makefile b/Makefile index f72184a10..91866cb12 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,8 @@ assets: test: @(GO111MODULE=on go test -race -v github.com/minio/console/restapi/...) + +test-pkg: @(GO111MODULE=on go test -race -v github.com/minio/console/pkg/...) coverage: