Skip to content

Commit

Permalink
fix release job tests execution
Browse files Browse the repository at this point in the history
  • Loading branch information
parvit committed Jun 4, 2024
1 parent a9e94cf commit e38ca82
Showing 1 changed file with 48 additions and 2 deletions.
50 changes: 48 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
description: 'Version tag'
type: 'string'
required: true
default: '0.0.1'
default: '0.4.0'

run-name: Release (version ${{ inputs.version_tag }}, draft ${{ inputs.test_release }}) [${{ github.event_name }}][${{ github.head_ref || github.ref_name }}]

Expand Down Expand Up @@ -73,6 +73,7 @@ jobs:

- name: Prepare
run: |
go install github.com/jstemmer/[email protected]
go clean -cache -x
- name: Build Backends
Expand All @@ -89,6 +90,27 @@ jobs:
name: qpep_linux_b${{ github.run_id }}
path: build/

- name: Test
if: ${{ inputs.test_release }}
run: |
set -x
for i in $(go list ./... | grep -v tray | sed -n -e 's/github.com\/parvit\/qpep\///p')
do
pushd $i
go test -v -gcflags=-l -cover -c -o qpep.$(basename $PWD).test || true
./qpep.$(basename $PWD).test -test.v -test.timeout 5m -test.coverprofile=cover.out &> unit_tests.out || true
cat unit_tests.out | go-junit-report > ../unit_tests_$(basename $PWD).xml
popd
done
continue-on-error: true

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: ${{ inputs.test_release }}
with:
check_name: "Unit Tests - Linux Platform"
junit_files: "unit_tests_*.xml"

build-windows:
needs: check-release
runs-on: windows-latest
Expand Down Expand Up @@ -138,12 +160,13 @@ jobs:

- name: Prepare
run: |
go install github.com/jstemmer/[email protected]
go clean -cache -x
MKDIR build
MKDIR build\64bits
MKDIR build\32bits
COPY /Y windivert\LICENSE build\LICENSE.windivert
COPY /Y LICENSE build\LICENSE
go clean -cache -x
COPY /Y windivert\x64\* build\64bits
- name: Build Backends
Expand Down Expand Up @@ -175,6 +198,29 @@ jobs:
name: qpep_windows_b${{ github.run_id }}
path: build/installer.msi

- name: Test
if: ${{ inputs.test_release }}
shell: bash
run: |
set -x
go generate github.com/parvit/qpep/windivert
for i in $(go list ./... | grep -v tray | sed -n -e 's/github.com\/parvit\/qpep\///p')
do
pushd $i
go test -v -gcflags=-l -cover -c -o qpep.$(basename $PWD).test || true
./qpep.$(basename $PWD).test -test.v -test.timeout 5m -test.coverprofile=cover.out &> unit_tests.out || true
cat unit_tests.out | go-junit-report > ../unit_tests_$(basename $PWD).xml
popd
done
continue-on-error: true

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action/composite@v2
if: ${{ inputs.test_release }}
with:
check_name: "Unit Tests - Windows Platform"
junit_files: "unit_tests_*.xml"

create-release-tag:
needs: [build-windows, build-linux]
runs-on: ubuntu-latest
Expand Down

0 comments on commit e38ca82

Please sign in to comment.