Skip to content

chore: remove extra newline (#11) #56

chore: remove extra newline (#11)

chore: remove extra newline (#11) #56

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
REVISION: ${{ github.event.pull_request.head.sha || github.sha }}
jobs:
build:
name: Build and Test
permissions:
issues: write
pull-requests: write
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Docker Build
run: make docker-build
- name: Build
run: make build
- name: Test
run: make test
- name: Create cover.txt
run: make cover.txt
- name: Upload Cover
run: |
make cover.html
git clone -b cover https://oauth2:${{ secrets.GITHUB_TOKEN }}@github.com/kilianc/base-golang-cli.git cover
cd cover
git config user.email "[email protected]"
git config user.name "GHA"
mv ../cover.html ${REVISION}.html
git add -f ${REVISION}.html
git commit -m "chore: add cover for ${REVISION}"
git push origin cover
- name: Post Code Coverage Comment
uses: actions/github-script@v6
if: ${{ github.event_name == 'pull_request' }}
with:
script: |
const script = require('${{ github.workspace }}/.github/update-code-coverage-comment.js')
await script({ context, github })
- name: Cover Check
run: make check-cover
- name: Version Check
run: make check-version
- name: Commit Check
run: make check-commit message='${{ github.event.pull_request.title }}'