Skip to content

tests: add github action for golang functions #1

tests: add github action for golang functions

tests: add github action for golang functions #1

---
name: golang-function-testing
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test-go-example:
runs-on: ubuntu-latest
strategy:
matrix:
tests: [
{ directory: 'cors-go', go-version: '1.19' }
]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go ${{ matrix.tests.go-version }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.tests.go-version}}
- name: Run test for ${{ matrix.tests.directory }}
uses: BerniWittmann/background-server-action@v1
with:
command: go run ./...
start: |
cd functions/${{ matrix.tests.directory }}
go run test/main.go
wait-on: 'http://localhost:8080'
wait-on-timeout: 60