Skip to content

Commit

Permalink
ci: run go tests in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
hpr1999 committed Aug 8, 2024
1 parent 761e75c commit 58cbfea
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: http-test.yml
on:
push:
branches:
- "*"

jobs:
Go-Tests:
permissions:
contents: read
actions: read
checks: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup Go
uses: actions/[email protected]
- name: Install dependencies
run: go get .
- name: Test with Go
run: go test -json ./... > TestResults.json
- name: Upload Go test results
if: success() || failure() # always run even if the previous step fails
uses: actions/upload-artifact@v4
with:
name: Go-Test-Results
path: TestResults.json
- name: Convert GoTest JSON to JUnit XML
uses: pl-strflt/gotest-json-to-junit-xml@v1
with:
input: TestResults.json
output: TestResults-JUnit.xml
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
with:
detailed_summary: true
include_passed: true
require_passed_tests: true
update_check: true
report_paths: TestResults-JUnit.xml
- name: Upload Go test JUnit report
uses: actions/upload-artifact@v4
with:
name: Go-Test-JUnit-Report
path: TestResults-JUnit.xml

0 comments on commit 58cbfea

Please sign in to comment.