2021-02-01 19:05:50 +03:00
|
|
|
name: test
|
2021-01-30 00:29:51 +03:00
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
rustfmt:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
profile: minimal
|
|
|
|
components: rustfmt
|
|
|
|
- name: Check formatting
|
|
|
|
run: |
|
|
|
|
cargo fmt --all -- --check
|
|
|
|
|
|
|
|
clippy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
profile: minimal
|
|
|
|
components: clippy
|
|
|
|
- name: Run Clippy
|
|
|
|
run: |
|
|
|
|
cargo clippy -- -D warnings
|
|
|
|
|
|
|
|
test-ubuntu:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
rust: [stable, nightly]
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ matrix.rust }}
|
|
|
|
override: true
|
|
|
|
profile: minimal
|
2021-02-01 23:49:34 +03:00
|
|
|
- name: Environment
|
2021-02-01 23:57:36 +03:00
|
|
|
run: |
|
2021-02-01 23:49:34 +03:00
|
|
|
uname -a
|
|
|
|
cargo --version
|
2021-01-30 00:29:51 +03:00
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
cargo build --verbose
|
|
|
|
- name: Test Prequisites
|
|
|
|
run: |
|
2021-02-06 14:15:32 +03:00
|
|
|
pip3 install Flask
|
|
|
|
cd integration
|
|
|
|
python3 server.py >server.log 2>&1 &
|
|
|
|
python3 ssl/server.py >server-ssl.log 2>&1 &
|
2021-01-30 00:29:51 +03:00
|
|
|
wget https://snapshots.mitmproxy.org/5.2/mitmproxy-5.2-linux.tar.gz -O - | tar -xz && ./mitmdump -p 8888 --modify-header "/From-Proxy/Hello" &
|
|
|
|
- name: Run Tests
|
|
|
|
run: |
|
|
|
|
cargo test
|
|
|
|
- name: Run Integration Tests
|
|
|
|
run: |
|
|
|
|
export PATH="$PWD/target/debug:$PATH"
|
2021-02-03 22:31:09 +03:00
|
|
|
cd integration
|
|
|
|
./integration.py
|
|
|
|
- name: Archive production artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
if: ${{ always() }}
|
|
|
|
with:
|
|
|
|
name: tests-ubuntu-${{ matrix.rust }}-artifacts
|
2021-02-06 14:15:32 +03:00
|
|
|
path: |
|
|
|
|
integration/server.log
|
|
|
|
integration/server-ssl.log
|
2021-01-30 00:29:51 +03:00
|
|
|
|
|
|
|
test-osx:
|
|
|
|
runs-on: macos-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
rust: [stable, nightly]
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ matrix.rust }}
|
|
|
|
override: true
|
|
|
|
profile: minimal
|
2021-02-01 23:49:34 +03:00
|
|
|
- name: Environment
|
2021-02-01 23:57:36 +03:00
|
|
|
run: |
|
2021-02-01 23:49:34 +03:00
|
|
|
uname -a
|
|
|
|
cargo --version
|
2021-01-30 00:29:51 +03:00
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
cargo build --verbose
|
|
|
|
- name: Test Prequisites
|
|
|
|
run: |
|
2021-02-06 14:15:32 +03:00
|
|
|
pip3 install Flask
|
|
|
|
cd integration
|
|
|
|
python3 server.py >server.log 2>&1 &
|
|
|
|
python3 ssl/server.py >server-ssl.log 2>&1 &
|
2021-01-30 00:29:51 +03:00
|
|
|
wget https://snapshots.mitmproxy.org/5.2/mitmproxy-5.2-osx.tar.gz -O - | tar -xz && ./mitmdump -p 8888 --modify-header "/From-Proxy/Hello" &
|
|
|
|
- name: Run Tests
|
|
|
|
run: |
|
|
|
|
cargo test
|
|
|
|
- name: Run Integration Tests
|
|
|
|
run: |
|
|
|
|
export PATH="$PWD/target/debug:$PATH"
|
2021-02-03 22:31:09 +03:00
|
|
|
cd integration
|
|
|
|
./integration.py
|
|
|
|
- name: Archive production artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
if: ${{ always() }}
|
|
|
|
with:
|
|
|
|
name: tests-osx-${{ matrix.rust }}-artifacts
|
2021-02-06 14:15:32 +03:00
|
|
|
path: |
|
|
|
|
integration/server.log
|
|
|
|
integration/server-ssl.log
|