mirror of
https://github.com/awalsh128/cache-apt-pkgs-action.git
synced 2025-12-28 06:11:28 +00:00
63 lines
1.3 KiB
YAML
63 lines
1.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [dev-v2.0]
|
|
pull_request:
|
|
branches: [dev-v2.0]
|
|
schedule:
|
|
- cron: 0 0 * * * # Run at 00:00 UTC every day
|
|
workflow_dispatch:
|
|
inputs:
|
|
debug:
|
|
description: Run in debug mode.
|
|
type: boolean
|
|
required: false
|
|
default: false
|
|
|
|
env:
|
|
DEBUG: ${{ github.event.inputs.debug || false }}
|
|
SHELLOPTS: errexit:pipefail
|
|
|
|
jobs:
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install golangci-lint
|
|
uses: golangci/golangci-lint-action@v4
|
|
with:
|
|
version: latest
|
|
|
|
- name: Golang Lint
|
|
run: golangci-lint run
|
|
|
|
- name: trunk.io Lint
|
|
uses: trunk-io/trunk-action@v1
|
|
with:
|
|
arguments: check
|
|
|
|
- name: Install Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.21"
|
|
cache: true
|
|
|
|
- name: Install Go module dependencies
|
|
run: go mod download
|
|
|
|
- name: Build
|
|
run: go build -v ./...
|
|
|
|
- name: Test with coverage
|
|
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v4
|
|
with:
|
|
files: ./coverage.txt
|
|
fail_ci_if_error: true
|
|
|