feat: adds action to update dependencies. #37
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: Regression Tests | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "**/*.md" | |
- "LICENSE" | |
pull_request: | |
paths-ignore: | |
- "**/*.md" | |
- "LICENSE" | |
jobs: | |
test: | |
strategy: | |
matrix: | |
go-version: [1.20.x, 1.21.x] | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go-version }} | |
cache: true | |
- name: Tests | |
run: go run mage.go test | |
check_changes: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.20.x | |
- name: Download CRS and Coraza config | |
run: go run mage.go downloadDeps | |
# Ref: https://gist.github.com/somidad/3ce6e8a7b7d77ac8fa7fad583003d6f5 | |
- name: Check if there are changes | |
id: changes | |
run: echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT | |
- name: Process changes | |
if: steps.changes.outputs.changed != 0 | |
run: | | |
echo 'Uncommited changes detected. Run `go run mage.go downloadDeps` to check the changes and commit them.' | |
exit 1 |