Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/Gotest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Gotest
on:
workflow_call:
inputs:
subrepo:
required: true
type: string
jobs:
go-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0

- uses: actions/setup-go@v6
with:
go-version-file: ./${{ inputs.subrepo }}/go.mod
cache-dependency-path: ./${{ inputs.subrepo }}/go.sum

# We could do this with service containers, but then we wouldn't be able to only run it when we're testing the backend.
- uses: ikalnytskyi/action-setup-postgres@10ab8a56cc77b4823c2bfa57b1d4dd5605ef0481 # v7
if: ${{ inputs.subrepo }} == 'backend'
with:
username: admin
password: admin
database: vote
ssl: false

- name: Run go tests
working-directory: ./${{ inputs.subrepo }}
run: go test github.com/${{ github.repository}}/${{ inputs.subrepo }}/...
7 changes: 7 additions & 0 deletions .github/workflows/Handoff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ jobs:
with:
subrepo: backend

backend-gotest:
needs: handoff
if: contains(needs.handoff.outputs.category, 'Go') && contains(needs.handoff.outputs.directory, 'backend')
uses: ./.github/workflows/Gotest.yml
with:
subrepo: backend

web-tsc:
needs: handoff
uses: ./.github/workflows/Tsc.yml
Expand Down