appleboy a934a831d2
ci: improve CI environment and reporting for Go tests
- Add gpg to the list of installed packages for testing
- Specify Codecov upload flags based on Go version

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-11-28 21:50:25 +08:00

56 lines
1.2 KiB
YAML

name: Lint and Testing
on:
push:
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true
- name: Setup golangci-lint
uses: golangci/golangci-lint-action@v7
with:
version: latest
args: --verbose
- uses: hadolint/hadolint-action@v3.1.0
name: hadolint for Dockerfile
with:
dockerfile: docker/Dockerfile
testing:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["1.24", "1.25"]
container:
image: golang:${{ matrix.go-version }}-alpine
options: --sysctl net.ipv6.conf.all.disable_ipv6=0
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: setup sshd server
run: |
apk add git make curl perl bash build-base zlib-dev ucl-dev sudo gpg
make ssh-server
- name: testing
run: |
make test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
flags: go-${{ matrix.go-version }}