-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitHub Action CI/CD Migration (#553)
* Refactored builds and tests into github actions Signed-off-by: Corbin Phelps <[email protected]> * Moved docker build and publish to github action Signed-off-by: Corbin Phelps <[email protected]> * Fixed up issues with makefile and ci/cd Signed-off-by: Corbin Phelps <[email protected]> * Updated readme badges Signed-off-by: Corbin Phelps <[email protected]> * Added action caches Signed-off-by: Corbin Phelps <[email protected]>
- Loading branch information
Corbin Phelps
authored
Feb 16, 2022
1 parent
ed8843f
commit 55abccb
Showing
8 changed files
with
183 additions
and
581 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Build is responsible for testing builds on all supported platforms. | ||
# It is broken up into three separate jobs with targeted builds so that each OS will | ||
# build in parallel and speed up overall CI time. | ||
name: Build | ||
on: | ||
pull_request: | ||
|
||
jobs: | ||
build_linux: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout Sources | ||
uses: actions/checkout@v2 | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: "1.17" | ||
check-latest: true | ||
- name: Cache Go Modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Build | ||
run: make build-linux | ||
build_darwin: | ||
runs-on: macos-11 | ||
steps: | ||
- name: Checkout Sources | ||
uses: actions/checkout@v2 | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: "1.17" | ||
check-latest: true | ||
- name: Cache Go Modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/Library/Caches/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Build | ||
run: make build-darwin | ||
build_windows: | ||
runs-on: windows-2019 | ||
steps: | ||
- name: Checkout Sources | ||
uses: actions/checkout@v2 | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: "1.17" | ||
check-latest: true | ||
- name: Cache Go Modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
%LocalAppData%\go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Build | ||
run: make build-windows |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Tests | ||
on: | ||
pull_request: | ||
|
||
jobs: | ||
unit-tests: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, macos-11, windows-2019] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout Sources | ||
uses: actions/checkout@v2 | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: "1.17" | ||
check-latest: true | ||
|
||
# Load caches based on OS | ||
- name: Linux Cache Go Modules | ||
if: matrix.os == 'ubuntu-20.04' | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: MacOS Cache Go Modules | ||
if: matrix.os == 'macos-11' | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/Library/Caches/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Windows Cache Go Modules | ||
if: matrix.os == 'windows-2019' | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
%LocalAppData%\go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Run Tests | ||
run: go test -race -coverprofile coverage.txt -coverpkg ./... ./... | ||
- name: Upload Codecov | ||
# Only submit code coverage if OS is Linux | ||
if: matrix.os == 'ubuntu-20.04' | ||
uses: codecov/[email protected] | ||
with: | ||
files: ./coverage.txt |
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