|
| 1 | +name: Webhook Bridge CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + paths: |
| 8 | + - 'webhook-bridge/**' |
| 9 | + - '.github/workflows/webhook-bridge-ci.yml' |
| 10 | + pull_request: |
| 11 | + paths: |
| 12 | + - 'webhook-bridge/**' |
| 13 | + - '.github/workflows/webhook-bridge-ci.yml' |
| 14 | + |
| 15 | +jobs: |
| 16 | + test-versions: |
| 17 | + name: Webhook Bridge CI |
| 18 | + runs-on: ubuntu-latest |
| 19 | + strategy: |
| 20 | + matrix: |
| 21 | + rust: [stable, beta] |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@master |
| 24 | + - uses: actions-rs/toolchain@v1 |
| 25 | + with: |
| 26 | + toolchain: ${{ matrix.rust }} |
| 27 | + override: true |
| 28 | + profile: minimal |
| 29 | + components: clippy, rustfmt |
| 30 | + - uses: Swatinem/rust-cache@v1 |
| 31 | + with: |
| 32 | + working-directory: webhook-bridge |
| 33 | + |
| 34 | + - name: rustfmt |
| 35 | + uses: actions-rs/cargo@v1 |
| 36 | + with: |
| 37 | + command: fmt |
| 38 | + args: --manifest-path webhook-bridge/Cargo.toml --all -- --check |
| 39 | + |
| 40 | + - name: Install dependencies |
| 41 | + # Packages should align with whatever is in the webhook-bridge/Dockerfile |
| 42 | + run: | |
| 43 | + sudo apt-get install -y \ |
| 44 | + build-essential=12.* \ |
| 45 | + checkinstall=1.* \ |
| 46 | + curl \ |
| 47 | + libssl-dev=* \ |
| 48 | + pkg-config=0.29.* \ |
| 49 | + protobuf-compiler=* \ |
| 50 | + zlib1g-dev=1:* |
| 51 | +
|
| 52 | + - name: Build |
| 53 | + uses: actions-rs/cargo@v1 |
| 54 | + with: |
| 55 | + command: build |
| 56 | + args: --manifest-path webhook-bridge/Cargo.toml --all --locked |
| 57 | + |
| 58 | + - name: Start dependencies |
| 59 | + run: docker-compose -f "webhook-bridge/testing-docker-compose.yml" up -d |
| 60 | + |
| 61 | + - name: Clippy |
| 62 | + uses: actions-rs/cargo@v1 |
| 63 | + with: |
| 64 | + command: clippy |
| 65 | + args: --manifest-path webhook-bridge/Cargo.toml --all --all-targets --all-features -- -D warnings |
| 66 | + |
| 67 | + - name: Run tests |
| 68 | + working-directory: ./webhook-bridge |
| 69 | + run: ./run-tests.sh |
| 70 | + |
| 71 | + - name: Stop dependencies |
| 72 | + run: docker-compose -f "webhook-bridge/testing-docker-compose.yml" down |
| 73 | + |
| 74 | +# deny-check: |
| 75 | +# name: cargo-deny check |
| 76 | +# runs-on: ubuntu-latest |
| 77 | +# continue-on-error: ${{ matrix.checks == 'advisories' }} |
| 78 | +# strategy: |
| 79 | +# matrix: |
| 80 | +# checks: |
| 81 | +# - advisories |
| 82 | +# - bans licenses sources |
| 83 | +# steps: |
| 84 | +# - uses: actions/checkout@v2 |
| 85 | +# - uses: EmbarkStudios/cargo-deny-action@v1 |
| 86 | +# with: |
| 87 | +# command: check ${{ matrix.checks }} |
| 88 | +# arguments: --all-features --manifest-path axum/Cargo.toml |
0 commit comments