Skip to content

Commit

Permalink
Run tests in all configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
soumeh01 committed Jul 31, 2023
1 parent 16214e9 commit 3fece5d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 29 deletions.
39 changes: 11 additions & 28 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,30 +89,30 @@ jobs:
go-junit-report -set-exit-code -in build/cbuildtests-${{ matrix.platform }}-amd64.txt -iocopy -out build/cbuildtests-${{ matrix.platform }}-amd64.xml
- name: Install qemu (for Linux-Arm64)
if: ${{ always() && startsWith(runner.os, 'Linux') }}
if: ${{ startsWith(runner.os, 'Linux') }}
run: |
sudo apt update
sudo apt-get install -y \
gcc-aarch64-linux-gnu \
g++-aarch64-linux-gnu \
qemu-user-binfmt
- name: Unit testing (for Linux-Arm64)
if: ${{ always() && startsWith(runner.os, 'Linux') }}
- name: Unit testing (for Arm64)
if: ${{ always() }}
run: |
GOOS=linux GOARCH=arm64 go test -v ./... > build/cbuildtests-${{ matrix.platform }}-arm64.txt
set GOARCH=arm64 && go test -v ./... > build/cbuildtests-${{ matrix.platform }}-arm64.txt
- name: Generate unit test report (for Linux-Arm64)
- name: Generate unit test report
if: success() || failure()
run: |
go-junit-report -set-exit-code -in build/cbuildtests-${{ matrix.platform }}-arm64.txt -iocopy -out build/cbuildtests-${{ matrix.platform }}-arm64.xml
go-junit-report -set-exit-code -in build/cbuildtests-${{ matrix.platform }}-arm64.txt -iocopy -out build/cbuild-testreport-${{ matrix.platform }}-arm64.xml
- name: Archive unit test results
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: unit-test-result-${{ matrix.platform }}
path: ./build/cbuildtests-*.xml
name: unit-test-result-${{ matrix.target }}-${{ matrix.arch }}
path: ./build/cbuild-testreport-*.xml
if-no-files-found: error

publish-test-results:
Expand All @@ -124,33 +124,16 @@ jobs:
needs: [ test ]
runs-on: ubuntu-latest
steps:
- name: Download unit test report windows
uses: actions/download-artifact@v3
with:
name: unit-test-result-windows-latest
path: testreports/

- name: Download unit test report linux
uses: actions/download-artifact@v3
with:
name: unit-test-result-ubuntu-latest
path: testreports/

- name: Download unit test report macos
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: unit-test-result-macos-latest
path: testreports/
path: artifacts

- name: publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: "testreports/*.xml"
files: "artifacts/**/cbuild-testreport-*.xml"
report_individual_runs: true
# with:
# commit: ${{ github.event.workflow_run.head_sha }}
# report_individual_runs: true
# junit_files: "testreports/*.xml"

coverage:
if: github.event_name != 'release'
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/configs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestGetInstallConfigs(t *testing.T) {
assert := assert.New(t)
t.Run("test get install configs with CMSIS_BUILD_ROOT", func(t *testing.T) {
err := os.Setenv("CMSIS_BUILD_ROOT", testRoot+"/run/bin")
assert.Error(err)
assert.Nil(err)
configs, err := GetInstallConfigs()
assert.Nil(err)
assert.NotEmpty(configs.BinPath)
Expand Down

0 comments on commit 3fece5d

Please sign in to comment.