Skip to content

refactor: simplified stdout/stderr mocking in tests #3547

refactor: simplified stdout/stderr mocking in tests

refactor: simplified stdout/stderr mocking in tests #3547

Workflow file for this run

name: rtx
on:
push:
tags: ["v*"]
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RTX_TRUSTED_CONFIG_PATHS: ${{ github.workspace }}
jobs:
unit:
runs-on: ubuntu-latest
#container: ghcr.io/jdx/rtx:github-actions
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: Swatinem/rust-cache@v2
with:
shared-key: unit
save-if: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- uses: taiki-e/install-action@v2
with:
tool: nextest,just,cargo-deny,cargo-msrv,cargo-machete
- name: Install direnv/shfmt
run: sudo apt-get update; sudo apt-get install direnv shfmt
- run: npm i -g markdown-magic prettier markdownlint-cli
- run: cargo nextest run --all-features
env:
RUST_BACKTRACE: "1"
- run: cargo deny check
- run: cargo msrv verify
- run: cargo machete --with-metadata
- run: just render-all lint-fix
- if: github.event_name == 'pull_request'
uses: EndBug/add-and-commit@v9
with:
push: true
author_name: rtx[bot]
author_email: [email protected]
- run: just lint
coverage:
name: coverage-${{matrix.tranche}}
#container: ghcr.io/jdx/rtx:github-actions
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
tranche: [0, 1, 2, 3]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
#- run: rustup toolchain install nightly --component llvm-tools-preview --profile minimal
- uses: Swatinem/rust-cache@v2
with:
shared-key: coverage
save-if: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
cache-all-crates: true
- run: sudo apt-get update; sudo apt-get install zsh fish direnv shfmt
- run: npm i -g markdown-magic
- uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov,just
- name: Test w/ coverage
uses: nick-fields/retry@v2
env:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUST_BACKTRACE: "1"
RTX_GITHUB_BOT_TOKEN: ${{ secrets.RTX_GITHUB_BOT_TOKEN }}
TEST_TRANCHE: ${{matrix.tranche}}
TEST_TRANCHE_COUNT: 4
with:
timeout_minutes: 30
max_attempts: 2
command: just test-coverage
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
files: lcov.info
# super-linter:
# runs-on: ubuntu-latest
# permissions:
# contents: read
# packages: read
# statuses: write
# steps:
# - name: Checkout Code
# uses: actions/checkout@v3
# with:
# # Full git history is needed to get a proper
# # list of changed files within `super-linter`
# fetch-depth: 0
#
# - name: Lint Code Base
# uses: super-linter/super-linter@v5
# env:
# VALIDATE_ALL_CODEBASE: false
# DEFAULT_BRANCH: main
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}