diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6483270..b6e76fe 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -25,20 +25,43 @@ jobs: with: dockerfile: docker/Dockerfile - testing: - runs-on: ubuntu-latest - container: golang:1.22-alpine + test: + strategy: + matrix: + os: [ubuntu-latest] + go: [1.21, 1.22, 1.23] + include: + - os: ubuntu-latest + go-build: ~/.cache/go-build + name: ${{ matrix.os }} @ Go ${{ matrix.go }} + runs-on: ${{ matrix.os }} + env: + GO111MODULE: on + GOPROXY: https://proxy.golang.org steps: - - name: Checkout repository + - name: Set up Go ${{ matrix.go }} + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go }} + + - name: Checkout Code uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} - - name: setup sshd server + - uses: actions/cache@v4 + with: + path: | + ${{ matrix.go-build }} + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Run Tests run: | - apk add git make curl perl bash build-base zlib-dev ucl-dev - - - name: testing - run: | - make test + go test -v -covermode=atomic -coverprofile=coverage.out - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 + with: + flags: ${{ matrix.os }},go-${{ matrix.go }}