Skip to content

Commit

Permalink
Merge pull request #26 from KonferCA/pipe/25/run-tests
Browse files Browse the repository at this point in the history
GitHub Action: Tests
  • Loading branch information
juancwu authored Nov 8, 2024
2 parents e5daa1a + d1000d6 commit 52158c4
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Tests On PR
on:
pull_request:
branches: ["main"]
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
cache: true
- name: Install dependencies
run: go mod download
- name: Run tests
run: go test -v ./...
# Comment test results on the PR
- name: Comment PR
if: always()
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: "const output = `#### Test Results\nTests: ${{ job.status }}\n\n*Workflow triggered by @${{ github.actor }}, ran on \\`${{ runner.os }}\\`*`;\n \ngithub.rest.issues.createComment({\n issue_number: context.issue.number,\n owner: context.repo.owner,\n repo: context.repo.repo,\n body: output\n})\n"

0 comments on commit 52158c4

Please sign in to comment.