Skip to content

ci: generate apk files #1291

ci: generate apk files

ci: generate apk files #1291

Workflow file for this run

on:
push:
branches:
- master
pull_request:
name: Test
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Test
run: go test ./... -coverprofile coverage.out
- name: Report coverage
uses: coverallsapp/github-action@v2
with:
file: coverage.out
parallel: true
flag-name: ${{ join(matrix.*, ' ') }}
test-integrity:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
env:
GOCOVERDIR: ${{ github.workspace }}/_icoverdir_
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Prepare lefthook
run: |
mkdir _icoverdir_
go install -cover
- name: Run integrity tests
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 3
command: go test integrity_test.go -tags=integrity
- name: Collect coverage
run: |
go tool covdata textfmt -i _icoverdir_ -o coverage.out
- name: Report coverage
uses: coverallsapp/github-action@v2
with:
file: coverage.out
format: golang
parallel: true
flag-name: integration-${{ join(matrix.*, ' ') }}
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build binaries
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: release --snapshot --skip=publish --skip=snapcraft --skip=validate --clean --verbose
- name: Tar binaries to preserve executable bit
run: 'tar -cvf lefthook-binaries.tar --directory dist/ $(find dist/ -executable -type f -printf "%P\0" | xargs --null)'
- name: Upload binaries as artifacts
uses: actions/upload-artifact@v4
with:
name: Executables
path: lefthook-binaries.tar
coverage:
runs-on: ubuntu-latest
needs:
- test
- test-integrity
steps:
- uses: coverallsapp/github-action@v2
with:
carryforward: "integration-ubuntu-latest,integration-macos-latest,integration-windows-latest,ubuntu-latest,macos-latest,windows-latest"
parallel-finished: true