Skip to content

ci: moved from super-linter to hk (#217) #73

ci: moved from super-linter to hk (#217)

ci: moved from super-linter to hk (#217) #73

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions: {}
jobs:
versions:
runs-on: ubuntu-latest
outputs:
tools: ${{ steps.mise.outputs.tools }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
with:
persist-credentials: false
- uses: yshrsmz/action-mise-values@92f49c5a07ebc7ffa957be5efa6a2c673578bbb0
id: mise
lint:
needs: versions
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- &checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
with:
persist-credentials: false
- &setup-go
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff
with:
go-version: ${{ fromJson(needs.versions.outputs.tools).go }}
- uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20
with:
version: v${{ fromJson(needs.versions.outputs.tools).golangci-lint }}
test:
needs: versions
environment: test
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- *checkout
- *setup-go
- uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151
- name: Test
run: mise test
- name: Coverage
run: mise run covercheck
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2
with:
token: ${{ secrets.CODECOV_TOKEN }}
build:
needs: [versions, lint, test]
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- *checkout
- *setup-go
- name: Build
run: go build .
release:
runs-on: ubuntu-latest
needs: [versions, build]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: write
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
with:
persist-credentials: false
fetch-depth: 0
- *setup-go
- uses: go-semantic-release/action@2e9dc4247a6004f8377781bef4cb9dad273a741f
with:
hooks: goreleaser
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}