ref(python): unordered field descriptors #59
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: test | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
env: | ||
CARGO_TERM_COLOR: always | ||
jobs: | ||
e2e-testing: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
runs-on: | ||
- ubuntu-latest | ||
- macos-latest | ||
- windows-latest | ||
runs-on: ${{ matrix.runs-on }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Setup Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
- name: Create dummy tag | ||
run: git tag -f CI | ||
# copied from https://github.com/BamPeers/rust-ci-github-actions-workflow | ||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-dependencies | ||
with: | ||
path: | | ||
~/.cargo/.crates.toml | ||
~/.cargo/.crates2.json | ||
~/.cargo/bin | ||
~/.cargo/registry/index | ||
~/.cargo/registry/cache | ||
target | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Cargo.lock') }} | ||
- name: Generate test result and coverage report | ||
id: cargo-testcov | ||
if: matrix.runs-on == "ubuntu-latest" | ||
Check failure on line 49 in .github/workflows/test.yml GitHub Actions / testInvalid workflow file
|
||
continue-on-error: true | ||
run: | | ||
cargo install cargo2junit grcov; | ||
cargo test $CARGO_OPTIONS -- -Z unstable-options --format json | cargo2junit > results.xml; | ||
zip -0 ccov.zip `find . \( -name "odoo_lsp*.gc*" \) -print`; | ||
grcov ccov.zip -s . -t lcov --llvm --ignore-not-existing --ignore "/*" --ignore "tests/*" -o lcov.info; | ||
- name: Upload test results | ||
uses: EnricoMi/publish-unit-test-result-action@v1 | ||
if: steps.cargo-testcov.outcome == 'success' | ||
with: | ||
check_name: Test Results | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
files: results.xml | ||
- name: Upload to CodeCov | ||
uses: codecov/codecov-action@v1 | ||
if: steps.cargo-testcov.outcome == 'success' | ||
with: | ||
# required for private repositories: | ||
# token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./lcov.info | ||
fail_ci_if_error: true | ||
- name: Run unit tests | ||
id: cargo-test | ||
if: matrix.runs-on != "ubuntu-latest" | ||
continue-on-error: true | ||
run: cargo test | ||
- name: Run tests | ||
working-directory: testing | ||
run: | | ||
pip install -U uv | ||
uv venv | ||
. ${{ matrix.runs-on == 'windows-latest' && '.venv/Scripts/activate' || '.venv/bin/activate'}} | ||
uv pip compile requirements.in -o requirements.txt | ||
uv pip sync requirements.txt | ||
pytest -vv --junitxml=.results.xml --color=yes | ||
- name: Report failures | ||
if: always() | ||
uses: pmeier/pytest-results-action@main | ||
with: | ||
path: testing/.results.xml | ||
summary: true | ||
fail-on-empty: false | ||
title: E2E Test Results | ||
- name: Fail if unit tests failed | ||
if: steps.cargo-test.outcome == 'failure' || steps.cargo-testcov.outcome == 'failure' | ||
run: exit 1 |