Skip to content

Commit

Permalink
chore: adds github action to pull latest coraza. (envoyproxy#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcchavezs authored Oct 4, 2022
1 parent b44b50c commit 22dc50f
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/nightly-coraza-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Nightly Coraza Check
on:
schedule:
- cron: "0 4 * * *"

env:
GO_VERSION: 1.18
TINYGO_VERSION: 0.25.0
WABT_VERSION: 1.0.29

jobs:
build:
runs-on: ubuntu-22.04
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 and wabt
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
gh release download ${WABT_VERSION} -p '*-ubuntu.tar.gz' -D ~ -R github.com/WebAssembly/wabt
tar -xf ~/wabt-${WABT_VERSION}-ubuntu.tar.gz -C $HOME
echo "$HOME/wabt-${WABT_VERSION}/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
uses: sergeysova/jq-action@v2
id: coraza-latest-commit
with:
cmd: curl -s https://api.github.com/repos/corazawaf/coraza/commits/v3/dev | jq -r .sha

- 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

0 comments on commit 22dc50f

Please sign in to comment.