diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5434521c..e2416951 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -89,7 +89,7 @@ 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 \ @@ -97,22 +97,22 @@ jobs: 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: @@ -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' diff --git a/pkg/utils/configs_test.go b/pkg/utils/configs_test.go index 94b137c7..3a736a9a 100644 --- a/pkg/utils/configs_test.go +++ b/pkg/utils/configs_test.go @@ -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)