Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breakout unit testing per OS. Issue: #353 #354

Merged
merged 13 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/build-test-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT

name: build-and-test-linux
on:
push:
branches: [master, main]
paths-ignore:
- '**.md'
- '.github/**'
- '!.github/workflows/build-*'


pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
linux-unittest:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ~1.15.15

- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: 'true'

- name: Cache build output
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}

- name: Test
run: make test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
verbose: true

- name: Build
run: make build
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: build-and-test
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT

name: build-and-test-macos
on:
push:
branches:
- master

branches: [master, main]
paths-ignore:
- '**.md'
- '.github/**'
Expand All @@ -20,51 +20,28 @@ concurrency:
cancel-in-progress: true

jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
include:
- os: ubuntu-latest
cachepath: |
~/.cache/go-build
~/go/pkg/mod
/home/runner/.cache/go-build
- os: macos-latest
cachepath: |
~/Library/Caches/go-build
~/go/pkg/mod
/Users/runner/Library/Caches/go-build
macos-unittest:
runs-on: macos-latest
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ~1.15.15
id: go

- name: Configure git with longpath enabled (for windows)
run: git config --global core.longpaths true

- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: 'true'

- name: Debug go.mod
run: cat go.mod

- name: Cache build output
uses: actions/cache@v2
with:
path: ${{ matrix.cachepath }}
path: |
~/Library/Caches/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Test
run: make test
Expand All @@ -75,4 +52,4 @@ jobs:
verbose: true

- name: Build
run: make build
run: make build
22 changes: 15 additions & 7 deletions .github/workflows/build-test-windows.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT

name: build-and-test-windows
on:
push:
branches:
- master

branches: [master, main]
paths-ignore:
- '**.md'
- '.github/**'
Expand Down Expand Up @@ -36,10 +36,18 @@ jobs:
path: |
%LocalAppData%\go-build
~/go/pkg/mod
C:\Users\runneradmin\AppData\Local\go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Install make
run: choco install make

- name: Run Unit tests
run: go test ./...
run: make test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
verbose: true

- name: Run build
run: make build