Skip to content

MEDIUM: add support for scheduled tasks via cron expressions #18

MEDIUM: add support for scheduled tasks via cron expressions

MEDIUM: add support for scheduled tasks via cron expressions #18

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
check:
if: ${{ github.event_name == 'pull_request' }}
name: HAProxy check commit message
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: 'go.mod'
# setup-go exports GOTOOLCHAIN=local via GITHUB_ENV; a later write wins.
- name: Allow Go toolchain downloads
run: echo "GOTOOLCHAIN=auto" >> "$GITHUB_ENV"
- name: Install Task
uses: go-task/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: commit-policy
run: task check-commit
tidy:
name: go mod tidy
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: 'go.mod'
check-latest: true
- name: Allow Go toolchain downloads
run: echo "GOTOOLCHAIN=auto" >> "$GITHUB_ENV"
- name: tidy
run: go mod tidy
- name: changes
run: test -z "$(git diff 2> /dev/null)" || exit "Go modules not tidied, issue \`go mod tidy\` and commit the result"
format:
name: gofumpt
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: 'go.mod'
- name: Allow Go toolchain downloads
run: echo "GOTOOLCHAIN=auto" >> "$GITHUB_ENV"
- name: Install Task
uses: go-task/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: format
run: task format
- name: changes
run: test -z "$(git diff 2> /dev/null)" || exit "Go code not formatted, issue \`task format\` and commit the result"
lint:
name: lint
needs: ["tidy", "format"]
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: 'go.mod'
- name: Allow Go toolchain downloads
run: echo "GOTOOLCHAIN=auto" >> "$GITHUB_ENV"
- name: Install Task
uses: go-task/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Lint
run: task lint
test:
name: test (${{ matrix.mode }})
needs: ["lint"]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mode: [root, rootless]
steps:
- name: Check out code
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: 'go.mod'
- name: Allow Go toolchain downloads
run: echo "GOTOOLCHAIN=auto" >> "$GITHUB_ENV"
- name: Install Task
uses: go-task/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
# rootless: e2e runs gopherd as a non-root UID (GOPHERD_E2E_ROOTLESS=1).
- name: Test
run: task test COUNT=1
env:
GOPHERD_E2E_ROOTLESS: ${{ matrix.mode == 'rootless' && '1' || '' }}
build:
name: build
needs: ["test"]
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: 'go.mod'
- name: Allow Go toolchain downloads
run: echo "GOTOOLCHAIN=auto" >> "$GITHUB_ENV"
- name: Build
run: go build -v .
govulncheck:
name: govulncheck
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: 'go.mod'
- name: Allow Go toolchain downloads
run: echo "GOTOOLCHAIN=auto" >> "$GITHUB_ENV"
- name: Install Task
uses: go-task/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: govulncheck
run: task govulncheck