Skip to content

Adds random_auth example #34

Adds random_auth example

Adds random_auth example #34

Workflow file for this run

name: Commit
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
rust:
name: Rust Build and Test (${{ matrix.platform.arch }})
runs-on: ${{ matrix.platform.os }}
defaults:
run:
working-directory: ./rust
strategy:
fail-fast: false
matrix:
platform:
- os: ubuntu-22.04
arch: amd64
- os: ubuntu-22.04-arm
arch: arm64
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache Cargo git index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-git-
- name: Set up Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: clippy, rustfmt
- name: Check formatting
run: cargo fmt -- --check
- name: Run Clippy linter
run: cargo clippy -- -D warnings
- name: Build project
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
docker_build:
name: Build and Push multi-arch Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login into GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
if: github.event_name != 'push'
with:
# TODO: setup caches.
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/envoyproxy/dynamic-modules-examples:${{ github.sha }}
- name: Build and push
uses: docker/build-push-action@v6
if: github.event_name == 'push'
with:
# TODO: setup caches.
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/envoyproxy/dynamic-modules-examples:${{ github.sha }},ghcr.io/envoyproxy/dynamic-modules-examples:latest
integration_test:
needs: [docker_build]
name: Integration Test (${{ matrix.platform.arch }})
runs-on: ${{ matrix.platform.os }}
defaults:
run:
working-directory: ./integration
strategy:
fail-fast: false
matrix:
platform:
- os: ubuntu-22.04
arch: amd64
- os: ubuntu-22.04-arm
arch: arm64
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
cache: false
go-version-file: integration/go.mod
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
~/go/bin
key: unittest-${{ hashFiles('**/go.mod', '**/go.sum') }}-${{ runner.os }}
- name: Run integration tests
env:
ENVOY_IMAGE: ghcr.io/envoyproxy/dynamic-modules-examples:${{ github.sha }}
run: go test -v -count=1 ./...