Daily jobs #975
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: Daily jobs | |
on: | |
schedule: | |
- cron: "30 1 * * *" | |
jobs: | |
periodics-gotest: | |
name: Run go tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: run tests | |
run: go test -json ./... > test.json | |
- name: Annotate tests | |
if: always() | |
uses: guyarb/[email protected] | |
with: | |
test-results: test.json | |
periodics-mark-stale: | |
name: Mark stale issues and PRs | |
runs-on: ubuntu-latest | |
steps: | |
# Stale by default waits for 60 days before marking PR/issues as stale, and closes them after 21 days. | |
# Do not expire the first issues that would allow the community to grow. | |
- uses: actions/stale@v8 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
stale-issue-message: 'This issue was automatically considered stale due to lack of activity. Please update it and/or join our slack channels to promote it, before it automatically closes (in 7 days).' | |
stale-pr-message: 'This PR was automatically considered stale due to lack of activity. Please refresh it and/or join our slack channels to highlight it, before it automatically closes (in 7 days).' | |
stale-issue-label: 'no-issue-activity' | |
stale-pr-label: 'no-pr-activity' | |
exempt-issue-labels: 'good first issue,keep' | |
days-before-close: 21 | |
check-docs-links: | |
name: Check docs for incorrect links | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Link Checker | |
uses: lycheeverse/lychee-action@ec3ed119d4f44ad2673a7232460dc7dff59d2421 | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
with: | |
args: --verbose --no-progress '*.md' '*.yaml' '*/*/*.go' --exclude-link-local | |
fail: true | |
vuln-scan: | |
name: Build image and scan it against known vulnerabilities | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Ensure go version | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: 'go.mod' | |
check-latest: true | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Setup GoReleaser | |
run: make bootstrap-tools | |
- name: Find current tag version | |
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
id: tags | |
- name: Build artifacts | |
run: VERSION="${{ steps.tags.outputs.sha_short }}" make image | |
- name: Run Trivy vulnerability scanner | |
uses: aquasecurity/trivy-action@41f05d9ecffa2ed3f1580af306000f734b733e54 | |
with: | |
image-ref: 'ghcr.io/${{ github.repository }}:${{ steps.tags.outputs.sha_short }}' | |
format: 'table' | |
exit-code: '1' | |
ignore-unfixed: true | |
vuln-type: 'os,library' | |
severity: 'CRITICAL,HIGH' |