Skip to content

Feat: aggregate request metrics #167

Feat: aggregate request metrics

Feat: aggregate request metrics #167

Workflow file for this run

name: Pull Request
on:
pull_request:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
jobs:
unit-test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cargo home
id: cargo-home
run: echo "path=${CARGO_HOME:-~/.cargo}" >>"$GITHUB_OUTPUT"
- uses: actions/cache@v4
with:
path: |
target
${{ steps.cargo-home.outputs.path }}
key: cargo-${{ hashFiles('**/Cargo.toml') }}
- run: cargo test --verbose --manifest-path dev/server/Cargo.toml
- run: cargo fmt --check --manifest-path dev/server/Cargo.toml
- run: cargo clippy --tests --manifest-path dev/server/Cargo.toml -- --deny warnings
- run: cargo test --verbose
- run: cargo test --verbose --no-default-features
- run: cargo test --verbose --no-default-features --features=json
- run: cargo test --verbose --no-default-features --features=yaml
- run: cargo test --verbose --no-default-features --features=json --features=yaml
- run: cargo test --verbose --no-default-features --features=json --features=yaml --features=cli
- run: cargo fmt --check
- run: RUSTDOCFLAGS="-D warnings" cargo doc --no-deps
- run: cargo clippy --tests -- --deny warnings
- run: cargo install cargo-readme && cargo readme > README.md
- run: git add -N . && git diff --exit-code -- README.md
e2e-test:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cargo home
id: cargo-home
run: echo "path=${CARGO_HOME:-~/.cargo}" >>"$GITHUB_OUTPUT"
- uses: actions/cache@v4
with:
path: |
target
${{ steps.cargo-home.outputs.path }}
key: cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Run develop http server (actual)
uses: ./.github/actions/run-develop-server
with:
port: 3001
- name: Run develop http server (expect)
uses: ./.github/actions/run-develop-server
with:
port: 3000
- name: Run relentless test and comment on pull request
id: run-test
run: |
set -euo pipefail
{
cargo run --features cli -- \
-f tests/config/basic/*.yaml -d actual=http://localhost:3001 -r github-markdown \
--no-color --ng-only --no-async-testcases --no-async-repeat
} > target/report.txt
- name: Comment on pull request
if: failure()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr comment ${{ github.event.number }} --body-file target/report.txt
version:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Check version in Cargo.toml and git tag
uses: ./.github/actions/versions
id: detect-version
- name: Add label
if: steps.detect-version.outputs.should-release == 'true'
run: |
gh pr edit ${{ github.event.pull_request.number }} --add-label "release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}