noraml-saturday: let there be rust #701
This file contains hidden or 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: Flag Engine Pull Request | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| test-rust: | |
| runs-on: ubuntu-latest | |
| name: Flag engine with Rust (Experimental) | |
| steps: | |
| - name: Cloning Python repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Cloning Rust repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: Flagsmith/flagsmith-rust-flag-engine | |
| ref: fix/who-needs-python | |
| path: rust-engine | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install Python Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt -r requirements-dev.txt | |
| - name: Install maturin | |
| run: pip install maturin | |
| - name: Build and install Rust extension | |
| run: | | |
| cd rust-engine | |
| maturin build --release --features python | |
| ls -la target/wheels/ | |
| pip install --force-reinstall target/wheels/*.whl | |
| pip list | grep flagsmith | |
| - name: Run Tests with Rust | |
| env: | |
| FLAGSMITH_USE_RUST: "1" | |
| run: pytest -p no:warnings | |
| - name: Run Benchmarks | |
| uses: CodSpeedHQ/action@v3 | |
| with: | |
| token: ${{ secrets.CODSPEED_TOKEN }} | |
| run: pytest --codspeed --no-cov | |