cicd: fail if tests fail #26
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create release | |
on: | |
push: | |
tags: | |
- v* | |
permissions: | |
contents: write | |
checks: write | |
jobs: | |
test: | |
name: Run test suite | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '1.22.1' | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
go mod download | |
- name: Build and run tests | |
run: make run-tests | |
- name: Install goveralls | |
run: go install github.com/mattn/goveralls@latest | |
- name: Send coverage | |
env: | |
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }} | |
run: goveralls -coverprofile=./testTarget/unit/cover.out -service=github | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: libtokenizers.a | |
path: ./artifacts/libtokenizers.a | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: onnxruntime.so | |
path: ./artifacts/onnxruntime.so | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: hugot-cli-linux-amd64 | |
path: ./artifacts/hugot-cli-linux-amd64 | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v4 | |
if: success() || failure() | |
with: | |
report_paths: './testTarget/unit/*.xml' | |
fail_on_failure: true | |
require_test: true | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: libtokenizers.a | |
path: . | |
- uses: actions/download-artifact@v4 | |
with: | |
name: onnxruntime.so | |
path: . | |
- uses: actions/download-artifact@v4 | |
with: | |
name: hugot-cli-linux-amd64 | |
path: . | |
- name: Display structure of downloaded files | |
run: ls -R | |
- uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "libtokenizers.a, onnxruntime.so, hugot-cli-linux-amd64" | |
generateReleaseNotes: true | |
skipIfReleaseExists: true |