ref(python): unordered field descriptors #67
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 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
e2e-testing: | |
strategy: | |
fail-fast: false | |
matrix: | |
runs-on: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
runs-on: ${{ matrix.runs-on }} | |
permissions: | |
checks: write | |
pull-requests: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
if: matrix.runs-on != 'ubuntu-latest' | |
- name: Setup Rust (nightly) | |
uses: dtolnay/rust-toolchain@nightly | |
if: matrix.runs-on == 'ubuntu-latest' | |
- 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@v4 | |
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: Install tools | |
if: matrix.runs-on == 'ubuntu-latest' | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo2junit,grcov | |
- name: Generate test result and coverage report | |
id: cargo-testcov | |
if: matrix.runs-on == 'ubuntu-latest' | |
continue-on-error: true | |
run: | | |
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; | |
env: | |
CARGO_INCREMENTAL: 0 | |
RUSTFLAGS: -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort | |
RUSTDOCFLAGS: -Cpanic=abort | |
- name: Upload test results | |
uses: EnricoMi/publish-unit-test-result-action@v1 | |
if: steps.cargo-testcov.outcome != 'skipped' | |
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 |