Skip to content

Commit bfad5b8

Browse files
committed
circleci: add parse_goflags command
1 parent a4e2f33 commit bfad5b8

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

.circleci/config.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
version: 2.1
22

33
orbs:
4-
golang: cci-orb/golang@volatile # https://circleci.com/orbs/registry/orb/cci-orb/golang
5-
codecov: codecov/codecov@volatile # https://circleci.com/orbs/registry/orb/codecov/codecov
4+
golang: cci-orb/golang@volatile
5+
codecov: codecov/[email protected]
6+
7+
commands:
8+
parse_goflags:
9+
steps:
10+
- run:
11+
name: "Parse CPUs"
12+
command: |
13+
CPUS="$(make env/JOBS)"
14+
echo "export GOFLAGS='-p=${CPUS} -cpu=${CPUS}'" >> $BASH_ENV
615
716
jobs:
817
test:
@@ -37,6 +46,7 @@ jobs:
3746
name: Run go mod vendor
3847
command: |
3948
go mod vendor
49+
- parse_goflags
4050
- run:
4151
name: Test and collect coverages
4252
environment:
@@ -45,16 +55,16 @@ jobs:
4555
# https://github.com/gotestyourself/gotestsum#junit-xml
4656
GOTESTSUM_JUNITFILE: /tmp/test-results/tests.xml
4757
# https://github.com/gotestyourself/gotestsum#finding-and-skipping-slow-tests
48-
GOTESTSUM_JSONFILE: /tmp/test-artifacts/tests.json
58+
GOTESTSUM_JSONFILE: /tmp/test-results/tests.json
4959
command: |
50-
mkdir -p /tmp/test-results /tmp/test-artifacts
60+
mkdir -p /tmp/test-results
5161
make coverage
5262
- codecov/upload:
5363
file: "coverage.out"
5464
- store_test_results:
5565
path: /tmp/test-results
5666
- store_artifacts:
57-
path: /tmp/test-artifacts
67+
path: /tmp/test-results
5868

5969
lint:
6070
parameters:

0 commit comments

Comments
 (0)