.github: create separate workflow to build CLI/image

There's too much jobs in Tests workflow, so we can split them into several parts.
This commit is contained in:
AnnaShaleva 2021-11-19 15:42:53 +03:00 committed by Anna Shaleva
parent f97f6168fc
commit b940167a6b
2 changed files with 80 additions and 65 deletions

80
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,80 @@
name: Build
on:
pull_request:
branches:
- master
types: [opened, synchronize]
paths-ignore:
- 'scripts/**'
- '**/*.md'
workflow_dispatch:
env:
GO111MODULE: "on"
jobs:
build_cli_ubuntu:
name: Build CLI (Ubuntu)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Restore Go modules from cache
uses: actions/cache@v2
with:
path: /home/runner/go/pkg/mod
key: deps-${{ hashFiles('go.sum') }}
- name: Update Go modules
run: go mod download -json
- name: Build CLI
run: make build
build_cli_win:
name: Build CLI (Windows)
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Restore Go modules from cache
uses: actions/cache@v2
with:
path: /home/runner/go/pkg/mod
key: deps-${{ hashFiles('go.sum') }}
- name: Update Go modules
run: go mod download -json
- name: Build CLI
run: make build
build_image:
needs: build_cli_ubuntu
name: Build Docker image
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build Docker image
run: make image

View file

@ -128,68 +128,3 @@ jobs:
- name: Run tests
run: go test -v -race ./...
build_cli_ubuntu:
name: Build CLI (Ubuntu)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Restore Go modules from cache
uses: actions/cache@v2
with:
path: /home/runner/go/pkg/mod
key: deps-${{ hashFiles('go.sum') }}
- name: Update Go modules
run: go mod download -json
- name: Build CLI
run: make build
build_cli_win:
name: Build CLI (Windows)
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Restore Go modules from cache
uses: actions/cache@v2
with:
path: /home/runner/go/pkg/mod
key: deps-${{ hashFiles('go.sum') }}
- name: Update Go modules
run: go mod download -json
- name: Build CLI
run: make build
build_image:
needs: build_cli_ubuntu
name: Build Docker image
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build Docker image
run: make image