hurl/.github/workflows/ci.yml
2020-12-13 14:57:09 +01:00

126 lines
3.0 KiB
YAML

name: CI
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
test:
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
- name: Build
run: |
cargo build --verbose
- name: Test Prequisites
run: |
pip3 install Flask && cd integration && python3 server.py &
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"
integration/integration.sh
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
release-linux:
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
- name: Check Rust Version
run: |
ci/check_version.sh
- name: set Version
run: |
echo VERSION=$(grep '^version' packages/hurl/Cargo.toml | cut -f2 -d'"') >> $GITHUB_ENV
- name: Build
run: |
ci/man.sh
ci/release.sh
ci/create_tarball.sh linux
ci/deb.sh
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
path: target/upload/*
release-osx:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- name: Check Rust Version
run: |
ci/check_version.sh
- name: set Version
run: |
echo VERSION=$(grep '^version' packages/hurl/Cargo.toml | cut -f2 -d'"') >> $GITHUB_ENV
- name: Build
run: |
ci/man.sh
ci/release.sh
ci/create_tarball.sh osx
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
path: target/upload/*