2021-11-19 12:42:53 +00:00
|
|
|
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
|
|
|
|
|
2021-11-19 12:23:51 +00:00
|
|
|
build_cli_wsc:
|
|
|
|
name: Build CLI (Windows Server Core)
|
|
|
|
runs-on: windows-2022
|
2021-11-19 12:42:53 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2021-11-19 12:23:51 +00:00
|
|
|
build_image_ubuntu:
|
2021-11-19 12:42:53 +00:00
|
|
|
needs: build_cli_ubuntu
|
2021-11-19 12:23:51 +00:00
|
|
|
name: Build Docker image (Ubuntu)
|
2021-11-19 12:42:53 +00:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Build Docker image
|
|
|
|
run: make image
|
2021-11-19 12:23:51 +00:00
|
|
|
|
|
|
|
build_image_wsc:
|
|
|
|
needs: build_cli_wsc
|
|
|
|
name: Build Docker image (Windows Server Core)
|
|
|
|
runs-on: windows-2022
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Build Docker image
|
|
|
|
run: make image-wsc
|