Skip to content

Commit

Permalink
Move multi-module tests to GH
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Koch <[email protected]>
  • Loading branch information
hugelgupf committed Feb 24, 2024
1 parent a74aeb9 commit 9f64bdd
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 52 deletions.
50 changes: 0 additions & 50 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,59 +14,17 @@ templates:
- CGO_ENABLED: 0
- GO111MODULE: "auto"

go120-template: &go120-template
docker:
- image: cimg/go:1.20

go121-template: &go121-template
docker:
- image: cimg/go:1.21

go122-template: &go122-template
docker:
- image: cimg/go:1.22

build-gomod-multi-template: &build-gomod-multi-template
steps:
- checkout
- run:
name: build u-root & gokrazy & p9 together (workspaces)
command: ./test-external.sh
- run:
name: build u-root & cpu & p9 together (GOPATH)
command: ./test-external-gopath.sh

workflows:
version: 2
build:
jobs:
- clean-gopath
- clean-gomod
- clean-makebb
- build-gomod-multi-go120:
requires:
- clean-makebb
- clean-gomod
- build-gomod-multi-go121:
requires:
- clean-makebb
- clean-gomod
- build-gomod-multi-go122:
requires:
- clean-makebb
- clean-gomod
nightly:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- main
jobs:
- build-gomod-multi-go120
- build-gomod-multi-go121
- build-gomod-multi-go122

jobs:
clean-makebb:
Expand Down Expand Up @@ -148,11 +106,3 @@ jobs:
(cd src && test -z "$(gofmt -s -l $(find -name '*.go'))")
(cd test && test -z "$(gofmt -s -l $(find -name '*.go'))")
build-gomod-multi-go120:
<<: [*go120-template, *gomod-template, *build-gomod-multi-template]

build-gomod-multi-go121:
<<: [*go121-template, *gomod-template, *build-gomod-multi-template]

build-gomod-multi-go122:
<<: [*go122-template, *gomod-template, *build-gomod-multi-template]
56 changes: 56 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,59 @@ jobs:
fail_ci_if_error: true
verbose: true

test-external-workspaces:
name: test-external-workspaces
runs-on: ubuntu-latest
strategy:
matrix:
goversion: ['1.20', '1.21.x', '1.22.x']
steps:
- uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.goversion }}

- name: Test
run: |
mkdir cover
GOCOVERDIR=$(pwd)/cover ./test-external-workspaces.sh
go tool covdata textfmt -i=cover -o cover.out
- uses: codecov/codecov-action@036b81c4b4e8314b391265bc226440f9e2117e2a
env:
CODECOV_TOKEN: 'bf25d8b2-b4f9-43f4-b578-64eefbe31e61'
with:
flags: ${{ matrix.goversion }}
fail_ci_if_error: true
verbose: true

test-external-gopath:
name: test-external-gopath
runs-on: ubuntu-latest
strategy:
matrix:
goversion: ['1.20', '1.21.x', '1.22.x']
steps:
- uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.goversion }}

- name: Test
run: |
mkdir cover
GOCOVERDIR=$(pwd)/cover ./test-external-gopath.sh
go tool covdata textfmt -i=cover -o cover.out
- uses: codecov/codecov-action@036b81c4b4e8314b391265bc226440f9e2117e2a
env:
CODECOV_TOKEN: 'bf25d8b2-b4f9-43f4-b578-64eefbe31e61'
with:
flags: ${{ matrix.goversion }}
fail_ci_if_error: true
verbose: true

3 changes: 1 addition & 2 deletions test-external.sh → test-external-workspaces.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ fi

cd src/cmd/makebb

$GO generate
$GO build
$GO build -covermode=atomic

cd ../../..

Expand Down

0 comments on commit 9f64bdd

Please sign in to comment.