Skip to content

Commit

Permalink
chore(ci): change build logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jeertmans committed Oct 18, 2024
1 parent 2e8beaf commit 02aec80
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
34 changes: 13 additions & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ jobs:

- name: Install dependencies
run: uv sync --locked --no-dev --extra tests
env:
RUSTFLAGS: -C=instrument-coverage

- name: Run tests
run: uv run pytest
Expand Down Expand Up @@ -119,14 +121,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/setup-python@v5
id: setup-python
with:
cache: pip
cache-dependency-path: uv.lock

- name: Setup uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
Expand All @@ -136,14 +134,11 @@ jobs:
- name: Cache Rust
uses: Swatinem/rust-cache@v2

- name: Install dependencies
run: uv pip install -r pyproject.toml --extra tests --python '${{ steps.setup-python.outputs.python-path }}'
- name: Install Just
uses: taiki-e/install-action@just

- name: Build differt-core for profiling
run: |
rm -f python/differt_core/*.so
pip install -v -e . --config-settings=build-args='--profile profiling'
working-directory: differt-core
- name: Install dependencies for profiling
run: just install-profiling --locked --no-dev --extra tests --python '${{ steps.setup-python.outputs.python-path }}'
env:
RUSTFLAGS: -Cprofile-generate=${{ github.workspace }}/profdata

Expand All @@ -157,11 +152,8 @@ jobs:
- name: Merge PGO data
run: rustup run stable bash -c '$RUSTUP_HOME/toolchains/$RUSTUP_TOOLCHAIN/lib/rustlib/${{ env.RUST_HOST }}/bin/llvm-profdata merge -o ${{ github.workspace }}/merged.profdata ${{ github.workspace }}/profdata'

- name: Build differt-core for benchmarking
run: |
rm -f python/differt_core/*.so
pip install -v -e . --config-settings=build-args='--profile profiling'
working-directory: differt-core
- name: Re-install dependencies
run: just install-profiling --locked --no-dev --extra tests --python '${{ steps.setup-python.outputs.python-path }}'
env:
RUSTFLAGS: -Cprofile-use=${{ github.workspace }}/merged.profdata

Expand Down Expand Up @@ -207,11 +199,11 @@ jobs:
with:
enable-cache: true

- name: Install dependencies
run: uv sync --locked --no-dev --extra docs

- name: Install Just
uses: taiki-e/install-action@just

- name: Install dependencies
run: just install --locked --no-dev --extra docs

- name: Check links in documentation
run: just docs/linkcheck
9 changes: 7 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,13 @@ devices:

# Build and install Python packages
[group: 'dev']
install:
uv sync
install *ARGS:
uv sync {{ARGS}}

# Build and install Python package(s) using 'profiling' profile
[group: 'dev']
install-profiling *ARGS:
uv sync --config-settings=build-args='--profile profiling' --reinstall-package differt_core {{ARGS}}

# Run code linters and formatters
[group: 'dev']
Expand Down

0 comments on commit 02aec80

Please sign in to comment.