-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #275 from atc0005/i165-use-docker-containers-for-c…
…i-work Use Docker-based GitHub Actions Workflows
- Loading branch information
Showing
3 changed files
with
51 additions
and
63 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 |
---|---|---|
|
@@ -20,79 +20,67 @@ name: Validate Codebase | |
# `synchronized` seems to equate to pushing new commits to a linked branch | ||
# (whether force-pushed or not) | ||
on: | ||
#push: | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
lint_and_build_code: | ||
name: Lint and Build codebase | ||
runs-on: ${{ matrix.os }} | ||
# Default: 360 minutes | ||
lint_code: | ||
name: Lint codebase | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
strategy: | ||
matrix: | ||
# Supported versions of Go | ||
go-version: [1.13.x, 1.14.x] | ||
container: | ||
image: index.docker.io/atc0005/go-ci:go-ci-lint-only | ||
|
||
# Supported LTS and latest version of Ubuntu Linux | ||
#os: [ubuntu-16.04, ubuntu-18.04, ubuntu-latest] | ||
steps: | ||
- name: Check out code | ||
uses: actions/[email protected] | ||
|
||
# This should be good enough until we learn otherwise | ||
os: [ubuntu-latest] | ||
- name: Run golangci-lint using repo-provided config file settings | ||
run: golangci-lint run -v | ||
|
||
steps: | ||
- name: Set up Go | ||
# https://github.com/actions/setup-go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
id: go | ||
# This is the very latest stable version of staticcheck provided by the | ||
# atc0005/go-ci container. The version included with golangci-lint often | ||
# lags behind the official stable releases. | ||
- name: Run staticcheck | ||
run: staticcheck $(go list -mod=vendor ./... | grep -v /vendor/) | ||
|
||
# This could prove useful if we need to troubleshoot odd results and | ||
# tie them back to a specific version of Go | ||
- name: Print go version | ||
run: | | ||
go version | ||
test_code: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
strategy: | ||
matrix: | ||
container-image: ["go-ci-oldstable", "go-ci-stable", "go-ci-unstable"] | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/[email protected] | ||
container: | ||
image: "index.docker.io/atc0005/go-ci:${{ matrix.container-image}}" | ||
|
||
# NOTE: Disabled in favor of top-level `vendor` folder | ||
# | ||
# - name: Get dependencies | ||
# run: | | ||
# go get -v -t -d ./... | ||
steps: | ||
- name: Check out code | ||
uses: actions/[email protected] | ||
|
||
# Force tests to run early as it isn't worth doing much else if the | ||
# tests fail to run properly. | ||
# Note: The `vendor` top-level folder appears to be skipped by default. | ||
- name: Run all tests | ||
run: go test -mod=vendor -v ./... | ||
|
||
- name: Install Go linting tools | ||
run: | | ||
# add executables installed with go get to PATH | ||
# TODO: this will hopefully be fixed by | ||
# https://github.com/actions/setup-go/issues/14 | ||
export PATH=${PATH}:$(go env GOPATH)/bin | ||
make lintinstall | ||
build_code: | ||
name: Build codebase | ||
runs-on: ubuntu-latest | ||
# Default: 360 minutes | ||
timeout-minutes: 10 | ||
strategy: | ||
matrix: | ||
container-image: ["go-ci-oldstable", "go-ci-stable", "go-ci-unstable"] | ||
|
||
- name: Install Ubuntu packages | ||
if: contains(matrix.os, 'ubuntu') | ||
run: sudo apt update && sudo apt install -y --no-install-recommends make gcc | ||
container: | ||
image: "index.docker.io/atc0005/go-ci:${{ matrix.container-image}}" | ||
|
||
- name: Run Go linting tools using project Makefile | ||
run: | | ||
# add executables installed with go get to PATH | ||
# TODO: this will hopefully be fixed by | ||
# https://github.com/actions/setup-go/issues/14 | ||
export PATH=${PATH}:$(go env GOPATH)/bin | ||
make linting | ||
steps: | ||
- name: Print go version | ||
run: go version | ||
|
||
- name: Build with (mostly) default options | ||
# Note: We use the `-mod=vendor` flag to explicitly request that our | ||
# top-level vendor folder be used instead of fetching remote packages | ||
run: go build -v -mod=vendor ./cmd/elbow | ||
- name: Check out code | ||
uses: actions/[email protected] | ||
|
||
- name: Build using project Makefile | ||
run: make all | ||
- name: Build using vendored dependencies | ||
run: go build -v -mod=vendor ./cmd/elbow |
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 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