CAP-2634 | fix: update outdated code and dependencies #39
Workflow file for this run
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [main, master, develop] | |
| pull_request: | |
| branches: [main, master, develop] | |
| permissions: | |
| contents: write | |
| jobs: | |
| CI: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. | |
| fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Verify dependencies | |
| run: | | |
| go mod verify | |
| - name: Validate module graph | |
| run: | | |
| go mod tidy | |
| git diff --exit-code go.mod go.sum | |
| - name: Build | |
| run: make build | |
| - name: SWAP | |
| run: | | |
| sudo swapon -s | |
| export PARTITION=$(sudo swapon -s | tail -n 1 | gawk '{print $1;}') | |
| sudo swapoff $PARTITION | |
| sudo swapon -s | |
| - name: Test | |
| run: make test_coverage | |
| - name: Go Coverage Badge # Pass the `coverage.out` output to this action | |
| uses: tj-actions/coverage-badge-go@v3 | |
| with: | |
| filename: coverage.out | |
| - name: Verify changed files | |
| uses: tj-actions/verify-changed-files@v20 | |
| id: verify-changed-files | |
| with: | |
| files: README.md | |
| - name: Commit changes | |
| if: steps.verify-changed-files.outputs.files_changed == 'true' | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add README.md | |
| git commit -m "chore: Updated coverage badge." | |
| - name: Push changes | |
| if: steps.verify-changed-files.outputs.files_changed == 'true' | |
| uses: ad-m/github-push-action@v1.0.0 | |
| with: | |
| github_token: ${{ github.token }} | |
| branch: ${{ github.head_ref || github.ref_name }} |