|
| 1 | +name:ci |
| 2 | + |
| 3 | +on: |
| 4 | +push: |
| 5 | + |
| 6 | +workflow_dispatch: |
| 7 | + |
| 8 | +permissions: |
| 9 | +actions:none |
| 10 | +checks:none |
| 11 | +contents:read |
| 12 | +deployments:none |
| 13 | +issues:none |
| 14 | +packages:none |
| 15 | +pull-requests:none |
| 16 | +repository-projects:none |
| 17 | +security-events:none |
| 18 | +statuses:none |
| 19 | + |
| 20 | +# Cancel in-progress runs for pull requests when developers push |
| 21 | +# additional changes |
| 22 | +concurrency: |
| 23 | +group:${{ github.workflow }}-${{ github.ref }} |
| 24 | +cancel-in-progress:${{ github.event_name == 'pull_request' }} |
| 25 | + |
| 26 | +jobs: |
| 27 | +test: |
| 28 | +runs-on:ubuntu-latest |
| 29 | +steps: |
| 30 | + -name:Checkout |
| 31 | +uses:actions/checkout@v3 |
| 32 | + |
| 33 | + -name:Echo Go Cache Paths |
| 34 | +id:go-cache-paths |
| 35 | +run:| |
| 36 | + echo "GOCACHE=$(go env GOCACHE)" >> ${{ runner.os == 'Windows' && '$env:' || '$' }}GITHUB_OUTPUT |
| 37 | + echo "GOMODCACHE=$(go env GOMODCACHE)" >> ${{ runner.os == 'Windows' && '$env:' || '$' }}GITHUB_OUTPUT |
| 38 | +
|
| 39 | + -name:Go Build Cache |
| 40 | +uses:actions/cache@v3 |
| 41 | +with: |
| 42 | +path:${{ steps.go-cache-paths.outputs.GOCACHE }} |
| 43 | +key:${{ runner.os }}-go-build-${{ hashFiles('**/go.**', '**.go') }} |
| 44 | + |
| 45 | +# Install Go! |
| 46 | + -uses:actions/setup-go@v3 |
| 47 | +with: |
| 48 | +go-version:"~1.21" |
| 49 | + |
| 50 | + -name:Test |
| 51 | +run:go test ./... |