41 lines
827 B
YAML
41 lines
827 B
YAML
name: Go Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
run: |
|
|
git clone \
|
|
"${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" \
|
|
.
|
|
|
|
git checkout "${GITHUB_SHA}"
|
|
|
|
- name: Verify checkout
|
|
run: |
|
|
pwd
|
|
ls -la
|
|
test -f go.mod
|
|
|
|
- name: Install Go
|
|
run: |
|
|
rm -rf /usr/local/go
|
|
curl -LO https://go.dev/dl/go1.26.2.linux-amd64.tar.gz
|
|
tar -C /usr/local -xzf go1.26.2.linux-amd64.tar.gz
|
|
export PATH=/usr/local/go/bin:$PATH
|
|
go version
|
|
|
|
- name: Download dependencies
|
|
run: |
|
|
go mod download
|
|
|
|
- name: Run tests
|
|
run: |
|
|
go test ./... -v |