forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: adds github action to pull latest coraza. (envoyproxy#20)
- Loading branch information
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
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
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 |