From 7ee79af1fec75159c824447460fd25555f238057 Mon Sep 17 00:00:00 2001 From: Adam Fisk Date: Tue, 4 Feb 2025 08:47:34 -0700 Subject: [PATCH] Added CI --- .github/workflows/test.yaml | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..3ee0f0a --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,43 @@ +name: Build and Test + +on: + push: + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: "go.mod" + - name: Install go go-ctrf-json-reporter + run: go install github.com/ctrf-io/go-ctrf-json-reporter/cmd/go-ctrf-json-reporter@latest + - name: Run tests + run: go test -json -race -tags="headless" -coverprofile=profile.cov ./... | go-ctrf-json-reporter -output ctrf-report.json + - name: Upload test results + uses: actions/upload-artifact@v4 + with: + name: ctrf-report + path: ctrf-report.json + - name: Publish Test Report + uses: ctrf-io/github-test-reporter@v1 + with: + report-path: 'ctrf-report.json' + if: always() + - name: Publish Test Summary Results + run: npx github-actions-ctrf ctrf-report.json + - name: Install goveralls + run: go install github.com/mattn/goveralls@latest + - name: Send coverage + env: + COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: goveralls -coverprofile=profile.cov -service=github