Nightly Coraza Check #915
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: Nightly Coraza Check | |
on: | |
pull_request: | |
paths: | |
- ".github/workflows/nightly-coraza-check.yaml" | |
- ".github/workflows/ci.yaml" | |
schedule: | |
- cron: "0 4 * * *" | |
env: | |
GO_VERSION: '1.22' | |
TINYGO_VERSION: 0.33.0 | |
jobs: | |
test: | |
name: "Test (multiphase evaluation: ${{ matrix.multiphase_eval }})" | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
multiphase_eval: ["true","false"] | |
env: | |
MULTIPHASE_EVAL: ${{ matrix.multiphase_eval }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
cache: true | |
- name: Install TinyGo | |
run: | | |
gh release download v${TINYGO_VERSION} -p '*.linux-amd64.tar.gz' -D ~ -R github.com/tinygo-org/tinygo | |
tar -xf ~/tinygo${TINYGO_VERSION}.linux-amd64.tar.gz -C $HOME | |
echo "$HOME/tinygo/bin" >> $GITHUB_PATH | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache TinyGo build | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/tinygo | |
key: ${{ runner.os }}-tinygo-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-tinygo- | |
- name: Get last commit of coraza | |
id: coraza-latest-commit | |
run: echo "value=$(gh api repos/corazawaf/coraza/commits/main -q .sha)" >> $GITHUB_OUTPUT | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Fetch last coraza version | |
run: go get -u github.com/corazawaf/coraza/v3@${{ steps.coraza-latest-commit.outputs.value }} && go mod tidy | |
- name: Build WASM filter | |
run: go run mage.go build | |
- name: Run unit tests | |
run: go run mage.go coverage | |
- name: Run e2e tests | |
run: go run mage.go e2e |