summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-06-11 12:42:16 +1000
committerJesse Duffield <jessedduffield@gmail.com>2022-06-11 13:06:29 +1000
commit02c5559704a9d46c4740f939781d142e8ce08298 (patch)
treefc9a3bfed70015c682e352987b19610fd6c59d0d /.github
parent32c0b39dbd3de89eb5fcc85efcef764c62311472 (diff)
run integration tests in parallel and properly cache windows build
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/ci.yml39
1 files changed, 37 insertions, 2 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f933ddb1b..721228000 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -10,13 +10,18 @@ on:
pull_request:
jobs:
- ci:
+ unit-tests:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
+ include:
+ - os: ubuntu-latest
+ cache_path: ~/.cache/go-build
+ - os: windows-latest
+ cache_path: ~\AppData\Local\go-build
name: ci - ${{matrix.os}}
runs-on: ${{matrix.os}}
env:
@@ -29,6 +34,36 @@ jobs:
with:
go-version: 1.18.x
- name: Cache build
+ uses: actions/cache@v3
+ with:
+ path: |
+ ${{matrix.cache_path}}
+ ~/go/pkg/mod
+ key: ${{runner.os}}-go-${{hashFiles('**/go.sum')}}-test
+ restore-keys: |
+ ${{runner.os}}-go-
+ - name: Test code
+ # we're passing -short so that we skip the integration tests, which will be run in parallel below
+ run: |
+ go test ./... -short
+ integration-tests:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ parallelism: [5]
+ index: [0,1,2,3,4]
+ name: "Integration Tests (${{ matrix.index }}/${{ matrix.parallelism }})"
+ env:
+ GOFLAGS: -mod=vendor
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+ - name: Setup Go
+ uses: actions/setup-go@v1
+ with:
+ go-version: 1.18.x
+ - name: Cache build
uses: actions/cache@v1
with:
path: ~/.cache/go-build
@@ -37,7 +72,7 @@ jobs:
${{runner.os}}-go-
- name: Test code
run: |
- bash ./test.sh
+ PARALLEL_TOTAL=${{ matrix.parallelism }} PARALLEL_INDEX=${{ matrix.index }} go test pkg/gui/gui_test.go
build:
runs-on: ubuntu-latest
env: