name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: test (${{ matrix.rust }})
strategy:
fail-fast: false
matrix:
rust: [stable, beta, nightly]
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Clippy
if: matrix.rust == 'stable'
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Build
run: |
cargo build --examples --all-features
cargo build --verbose --workspace --all-features
- name: Unit tests
run: cargo test --lib --verbose --all-features
- name: Install 3proxy and socat
run: |
sudo apt-get update
sudo apt-get install -y socat
curl -sSL -o "${RUNNER_TEMP}/3proxy.tar.gz" \
https://github.com/3proxy/3proxy/archive/refs/tags/0.8.13.tar.gz
tar -C "${RUNNER_TEMP}" -xzf "${RUNNER_TEMP}/3proxy.tar.gz"
ln -s Makefile.Linux "${RUNNER_TEMP}/3proxy-0.8.13/Makefile"
make -C "${RUNNER_TEMP}/3proxy-0.8.13" -j"$(nproc)"
echo "${RUNNER_TEMP}/3proxy-0.8.13/src" >> "$GITHUB_PATH"
- name: Integration tests
run: bash tests/integration_tests.sh