Skip to content

Update test runner to Go 1.22 (#113) #249

Update test runner to Go 1.22 (#113)

Update test runner to Go 1.22 (#113) #249

Workflow file for this run

name: Run linter and tests
on: [push, pull_request, workflow_dispatch]
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- name: Install Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
with:
go-version: 1.22.x
- name: Checkout code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- name: Run linters
uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64
with:
version: v1.59.1
test:
strategy:
matrix:
platform: [ubuntu-22.04, windows-2022]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
if: success()
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
with:
go-version: 1.22.x
- name: Checkout code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- name: Run tests
run: go test ./... -v -covermode=count
smoke-tests:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4c0219f9ac95b02789c1075625400b2acbff50b1
with:
install: true
- name: Build Docker image and store in cache
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
with:
context: .
push: false
load: true
tags: exercism/go-test-runner
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Run Tests in Docker
run: bin/run-tests-in-docker.sh
coverage:
runs-on: ubuntu-22.04
steps:
- name: Install Go
if: success()
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
with:
go-version: 1.22.x
- name: Checkout code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- name: Calc coverage
run: |
go test ./... -v -covermode=count -coverprofile=coverage.out
- name: Convert coverage.out to coverage.lcov
uses: jandelgado/gcov2lcov-action@c680c0f7c7442485f1749eb2a13e54a686e76eb5
- name: Coveralls
uses: coverallsapp/github-action@9ba913c152ae4be1327bfb9085dc806cedb44057
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: coverage.lcov