ci: add ci/cd process #1
Workflow file for this run
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: Tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- release/** | |
jobs: | |
cleanup-runs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: rokroskar/workflow-run-cleanup-action@master | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'" | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: technote-space/[email protected] | |
with: | |
PATTERNS: | | |
**/**.go | |
go.mod | |
go.sum | |
- uses: actions/setup-go@v4 | |
if: env.GIT_DIFF | |
with: | |
go-version: '1.20' | |
cache: true | |
- name: Test | |
if: env.GIT_DIFF | |
run: | | |
make test-unit | |
test-e2e: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: technote-space/[email protected] | |
with: | |
PATTERNS: | | |
**/**.go | |
go.mod | |
go.sum | |
- uses: actions/setup-go@v4 | |
if: env.GIT_DIFF | |
with: | |
go-version: '1.20' | |
cache: true | |
- name: cache docker layer | |
uses: satackey/[email protected] | |
if: env.GIT_DIFF | |
continue-on-error: true | |
- name: Test E2E | |
if: env.GIT_DIFF | |
run: | | |
make test-e2e |