Reorganize prediction-market tests #932
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Coverage | |
on: | |
pull_request: | |
types: [ labeled ] | |
push: | |
branches: [ main ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
coverage: | |
name: Coverage | |
if: | | |
github.event_name == 'pull_request' && | |
(contains(github.event.pull_request.labels.*.name, 's:review-needed') || | |
contains(github.event.pull_request.labels.*.name, 's:accepted')) || | |
github.event_name == 'push' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install rust toolchain | |
run: rustup show | |
- uses: actions-rs/[email protected] | |
with: | |
crate: grcov | |
use-tool-cache: true | |
# No disk space: https://github.com/zeitgeistpm/zeitgeist/actions/runs/5085081984/jobs/9144298675?pr=1006 | |
# Workaround: https://github.com/actions/runner-images/issues/2840#issuecomment-790492173 | |
- name: Free up disk space on GitHub hosted runners | |
run: | | |
# Ensure context is GitHub hosted runner | |
# https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context | |
if [[ "${{ runner.name }}" == "GitHub Actions"* ]]; then | |
echo "Freeing up space in GitHub hosted runner" | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
fi | |
- name: Cache Dependencies | |
uses: Swatinem/rust-cache@v1 | |
- name: Generate coverage report | |
run: ./scripts/tests/coverage.sh | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ${{ runner.temp }}/zeitgeist-test-coverage.lcov | |
fail_ci_if_error: true | |
flags: tests | |
verbose: true | |
name: unit-tests |