From ecaf62d2352a31c1f8731565a5f11238506848e7 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Ruel Date: Sat, 16 Oct 2021 18:28:39 -0400 Subject: [PATCH] gohci and github actions: improve testing --- .github/workflows/test.yml | 4 +- .gohci.yml | 150 ++++++++++++++++++++++++------------- 2 files changed, 102 insertions(+), 52 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c838834..86ea305 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -139,7 +139,7 @@ jobs: - name: 'Check: go test -cover' run: go test -timeout=40s -covermode=count -coverprofile coverage.txt ./... # Don't send code coverage if anything failed to reduce spam. - - uses: codecov/codecov-action@v1 + - uses: codecov/codecov-action@v2 - name: 'Cleanup' run: rm coverage.txt # Don't run go test -race if anything failed, to speed up the results. @@ -194,7 +194,7 @@ jobs: git clone https://github.com/periph/cmd cd cmd go mod edit -replace=periph.io/x/devices/v3=../devices - go get ./... + go get -t ./... go test -short ./... - name: 'Send comments' diff --git a/.gohci.yml b/.gohci.yml index 2cfc559..041d71f 100644 --- a/.gohci.yml +++ b/.gohci.yml @@ -17,26 +17,35 @@ workers: - -benchtime=1000ms - -benchmem - ./... - # Test in advance. - - cmd: + # Test in advance: cmd + - dir: .. + cmd: - git - clone - --depth - 1 - https://github.com/periph/cmd - dir: .. - - cmd: + - dir: ../cmd + cmd: + - go + - mod + - edit + - -replace=periph.io/x/devices/v3=../devices + - dir: ../cmd + cmd: - go - get - - periph.io/x/devices/v3@${GIT_SHA} - dir: ../cmd - - cmd: + - -t + - ./... + - dir: ../cmd + cmd: - go - test + - -short - ./... - dir: ../cmd # Test commands. - - cmd: + - dir: ../cmd + cmd: - go - install - -v @@ -45,7 +54,6 @@ workers: - ./periph-info - ./periph-smoketest - ./spi-list - dir: ../cmd - cmd: - periph-info - cmd: @@ -75,26 +83,35 @@ workers: - -benchtime=1000ms - -benchmem - ./... - # Test in advance. - - cmd: + # Test in advance: cmd + - dir: .. + cmd: - git - clone - --depth - 1 - https://github.com/periph/cmd - dir: .. - - cmd: + - dir: ../cmd + cmd: + - go + - mod + - edit + - -replace=periph.io/x/devices/v3=../devices + - dir: ../cmd + cmd: - go - get - - periph.io/x/devices/v3@${GIT_SHA} - dir: ../cmd - - cmd: + - -t + - ./... + - dir: ../cmd + cmd: - go - test + - -short - ./... - dir: ../cmd # Test commands. - - cmd: + - dir: ../cmd + cmd: - go - install - -v @@ -104,7 +121,6 @@ workers: - ./periph-info - ./periph-smoketest - ./spi-list - dir: ../cmd - cmd: - periph-info - cmd: @@ -147,26 +163,35 @@ workers: - -benchtime=1000ms - -benchmem - ./... - # Test in advance. - - cmd: + # Test in advance: cmd + - dir: .. + cmd: - git - clone - --depth - 1 - https://github.com/periph/cmd - dir: .. - - cmd: + - dir: ../cmd + cmd: + - go + - mod + - edit + - -replace=periph.io/x/devices/v3=../devices + - dir: ../cmd + cmd: - go - get - - periph.io/x/devices/v3@${GIT_SHA} - dir: ../cmd - - cmd: + - -t + - ./... + - dir: ../cmd + cmd: - go - test + - -short - ./... - dir: ../cmd # Test commands. - - cmd: + - dir: ../cmd + cmd: - go - install - -v @@ -176,7 +201,6 @@ workers: - ./periph-info - ./periph-smoketest - ./spi-list - dir: ../cmd - cmd: - periph-info - cmd: @@ -223,6 +247,11 @@ workers: - periph-smoketest - bcm283x - -quick + - cmd: + - periph-smoketest + - ftdi + - -type + - ft232h # Old MacBook Pro on 10.9. - name: mbp @@ -235,26 +264,35 @@ workers: - -benchtime=1000ms - -benchmem - ./... - # Test in advance. - - cmd: + # Test in advance: cmd + - dir: .. + cmd: - git - clone - --depth - 1 - https://github.com/periph/cmd - dir: .. - - cmd: + - dir: ../cmd + cmd: + - go + - mod + - edit + - -replace=periph.io/x/devices/v3=../devices + - dir: ../cmd + cmd: - go - get - - periph.io/x/devices/v3@${GIT_SHA} - dir: ../cmd - - cmd: + - -t + - ./... + - dir: ../cmd + cmd: - go - test + - -short - ./... - dir: ../cmd # Test commands. - - cmd: + - dir: ../cmd + cmd: - go - install - -v @@ -264,7 +302,6 @@ workers: - ./periph-info - ./periph-smoketest - ./spi-list - dir: ../cmd - cmd: - periph-info - cmd: @@ -277,6 +314,11 @@ workers: - i2c-list - cmd: - spi-list + - cmd: + - periph-smoketest + - ftdi + - -type + - ft232r # Laptop on Windows 10. - name: win10 @@ -289,26 +331,35 @@ workers: - -benchtime=1000ms - -benchmem - ./... - # Test in advance. - - cmd: + # Test in advance: cmd + - dir: .. + cmd: - git - clone - --depth - 1 - https://github.com/periph/cmd - dir: .. - - cmd: + - dir: ../cmd + cmd: + - go + - mod + - edit + - -replace=periph.io/x/devices/v3=../devices + - dir: ../cmd + cmd: - go - get - - periph.io/x/devices/v3@${GIT_SHA} - dir: ../cmd - - cmd: + - -t + - ./... + - dir: ../cmd + cmd: - go - test + - -short - ./... - dir: ../cmd # Test commands. - - cmd: + - dir: ../cmd + cmd: - go - install - -v @@ -318,7 +369,6 @@ workers: - ./periph-info - ./periph-smoketest - ./spi-list - dir: ../cmd - cmd: - periph-info - cmd: