hurl/.github/workflows/test.yml
2022-10-06 15:16:38 +02:00

254 lines
7.4 KiB
YAML

name: test
on: [pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
benchsuite:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Environment
run: bin/environment.sh
- name: Install Prerequisites
run: bin/install_prerequisites_ubuntu.sh
- name: Install Rust
run: bin/install_rust_latest.sh
- name: Build
run: |
bin/release/release.sh
echo "PATH=${PWD}/target/release:$PATH" >> "${GITHUB_ENV}"
- name: Bench Suite
run: bin/test/bench.sh
- name: Archive artifacts
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: tests-bench-artifacts
path: |
bench/server.log
test-ubuntu-x64-latest:
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Environment
run: bin/environment.sh
- name: Install Prerequisites
run: bin/install_prerequisites_ubuntu.sh
- name: Install Rust
run: bin/install_rust_latest.sh
- name: Test Prerequisites
run: bin/test/test_prerequisites.sh
- name: Tests units
run: |
bin/test/test_unit.sh
echo "PATH=${PWD}/target/release:$PATH" >> "${GITHUB_ENV}"
- name: Integration Tests
run: bin/test/test_integ.sh
- name: Archive production artifacts
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: tests-ubuntu-${{ matrix.rust }}-artifacts
path: |
integration/server.log
integration/server-ssl.log
integration/report/tests.json
integration/report/tests.xml
test-ubuntu-x64-18-04:
runs-on: ubuntu-18.04
strategy:
matrix:
rust: [stable]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install Curl 7.68
uses: myci-actions/add-deb-repo@10
with:
repo: deb http://azure.archive.ubuntu.com/ubuntu/ focal main restricted
repo-name: focal
install: curl
- name: Environment
run: bin/environment.sh
- name: Install Prerequisites
run: bin/install_prerequisites_ubuntu.sh
- name: Install Rust
run: bin/install_rust_latest.sh
- name: Test Prerequisites
run: bin/test/test_prerequisites.sh
- name: Tests units
run: |
bin/test/test_unit.sh
echo "PATH=${PWD}/target/release:$PATH" >> "${GITHUB_ENV}"
- name: Integration Tests
run: bin/test/test_integ.sh
- name: Archive production artifacts
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: tests-ubuntu-${{ matrix.rust }}-artifacts
path: |
integration/server.log
integration/server-ssl.log
integration/report/tests.json
integration/report/tests.xml
test-docker-archlinux-x64:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build, Test units and Integration tests
uses: addnab/docker-run-action@v3
with:
image: archlinux
options: --volume ${{ github.workspace }}:/work --workdir /work --privileged --env CARGO_TERM_COLOR=always
run: |
bin/environment.sh
bin/install_prerequisites_archlinux.sh
bin/install_rust_latest.sh
bin/test/test.sh
- name: Archive production artifacts
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: tests-archlinux-x64-artifacts
path: |
integration/mitmdump.log
integration/server.log
integration/server-ssl.log
test-docker-fedora-x64:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build, Test units and Integration tests
uses: addnab/docker-run-action@v3
with:
image: fedora
options: --volume ${{ github.workspace }}:/work --workdir /work --privileged --env CARGO_TERM_COLOR=always
run: |
bin/environment.sh
bin/install_prerequisites_fedora.sh
bin/install_rust_latest.sh
bin/test/test.sh
- name: Archive production artifacts
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: tests-fedora-x64-artifacts
path: |
integration/mitmdump.log
integration/server.log
integration/server-ssl.log
test-docker-alpine-x64:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build, Test units and Integration tests
uses: addnab/docker-run-action@v3
with:
image: alpine
options: --volume ${{ github.workspace }}:/work --workdir /work --privileged --env CARGO_TERM_COLOR=always --env RUSTFLAGS=-Ctarget-feature=-crt-static
run: |
bin/environment.sh
bin/install_prerequisites_alpine.sh
bin/install_rust_latest.sh
bin/test/test.sh
- name: Archive production artifacts
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: tests-alpine-x64-artifacts
path: |
integration/mitmdump.log
integration/server.log
integration/server-ssl.log
test-macos-x64:
runs-on: macos-latest
strategy:
matrix:
rust: [stable]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Environment
run: bin/environment.sh
- name: Install Rust
run: bin/install_rust_latest.sh
- name: Test Prerequisites
run: bin/test/test_prerequisites.sh
- name: Tests units
run: |
bin/test/test_unit.sh
echo "PATH=${PWD}/target/release:$PATH" >> "${GITHUB_ENV}"
- name: Integration Tests
run: bin/test/test_integ.sh
- name: Archive production artifacts
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: tests-macos-${{ matrix.rust }}-artifacts
path: |
integration/server.log
integration/server-ssl.log
test-windows-x64:
runs-on: windows-latest
strategy:
matrix:
rust: [stable]
env:
VCPKGRS_DYNAMIC: 1
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: C:\vcpkg\installed
key: ${{ runner.os }}-test-windows-x64-${{ github.sha }}
restore-keys: ${{ runner.os }}-test-windows-x64-
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- name: Environment
run: .\bin\environment.ps1
- name: Install Prerequisites
run: .\bin\install_prerequisites_windows.ps1
- name: Build and test
run: .\bin\test\test.ps1
- name: Archive production artifacts
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: tests-win64-${{ matrix.rust }}-artifacts
path: |
integration/mitmdump.log
integration/server.log
integration/server-ssl.log