Resolve commit ref correctly. #469
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- name: setup go | |
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v4 | |
with: | |
go-version-file: ./go.mod | |
- name: setup task | |
uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 # v1 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
# Builds the binary into the bin/ directory | |
- name: build | |
run: |- | |
task build | |
- name: upload artifact | |
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 | |
with: | |
name: frizbee | |
path: bin/frizbee | |
cover: | |
name: Coverage | |
permissions: | |
contents: read | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- name: Set up Go | |
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v4 | |
with: | |
go-version-file: 'go.mod' | |
- name: setup task | |
uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 # v1 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run coverage | |
run: task cover | |
# Using gcov didn't seem to work for the coveralls app, so we convert it to lcov | |
- name: Try converting to LCOV | |
run: go run github.com/jandelgado/gcov2lcov@latest -infile=./coverage.out -outfile=./coverage.lcov | |
- name: Coveralls GitHub Action | |
uses: coverallsapp/github-action@643bc377ffa44ace6394b2b5d0d3950076de9f63 # v2.3.0 | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- name: setup go | |
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v4 | |
with: | |
go-version-file: ./go.mod | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v3 | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- name: setup go | |
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v4 | |
with: | |
go-version-file: ./go.mod | |
- name: setup task | |
uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 # v1 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: test | |
run: |- | |
task test | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Checks that the github workflows are valid using this same tool | |
frizbee: | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- name: checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- name: download artifact | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 #v4.1.8 | |
with: | |
name: frizbee | |
path: bin/ | |
- name: Make frizbee executable | |
run: |- | |
chmod +x bin/frizbee | |
- name: Frizbee | |
run: |- | |
bin/frizbee actions --dry-run --error | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |