diff --git a/.github/workflows/docs-python.yml b/.github/workflows/docs-python.yml index 73721bb..e1a712b 100644 --- a/.github/workflows/docs-python.yml +++ b/.github/workflows/docs-python.yml @@ -19,6 +19,11 @@ concurrency: jobs: build-python-docs: + strategy: + fail-fast: true + matrix: + python-version: ['3.12'] + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -26,7 +31,7 @@ jobs: - name: Create virtual environment run: | curl -LsSf https://astral.sh/uv/install.sh | sh - uv venv + uv venv -p ${{ matrix.python-version }} echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV @@ -34,6 +39,16 @@ jobs: working-directory: docs run: uv pip install -r requirements-docs.txt + # Cache HDF5 + - uses: awalsh128/cache-apt-pkgs-action@latest + name: Cache apt packages + with: + packages: libhdf5-dev + version: 1.0 + + - name: Install up4 + run: uv pip install . + - name: Build Python documentation working-directory: docs run: make html diff --git a/.github/workflows/lint-rust.yml b/.github/workflows/lint-rust.yml index 525aae4..d028b08 100644 --- a/.github/workflows/lint-rust.yml +++ b/.github/workflows/lint-rust.yml @@ -28,32 +28,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - # If rustup is a valid command, we can assume that rust is installed, - # this is to mainly assist with testing locally via act. - - name: Determine if Rust is installed - run: | - if ! command -v rustup &> /dev/null - then - echo "RUNNING_LOCALLY=1" >> $GITHUB_ENV - else - echo "RUNNING_LOCALLY=0" >> $GITHUB_ENV - fi - - # Rust doesn't already exist - need to install rustup and - # update apt packages to install libhdf5-dev locally - # (https://github.com/awalsh128/cache-apt-pkgs-action/issues/125) - - if: env.RUNNING_LOCALLY == '1' - name: Install Rust - uses: actions-rs/toolchain@v1 - with: {toolchain: 'stable', profile: minimal, override: true} - - - if: env.RUNNING_LOCALLY == '1' - run: sudo apt-get update - - # Rust already exists, so we can skip the installation - - if: env.RUNNING_LOCALLY == '0' - name: Set up Rust + + - name: Set up Rust run: rustup override set stable && rustup update - uses: awalsh128/cache-apt-pkgs-action@latest diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index 2bd1bea..c64140b 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -36,7 +36,7 @@ jobs: test-python: runs-on: ${{ matrix.os }} strategy: - fail-fast: false + fail-fast: true matrix: os: [ubuntu-latest] python-version: ['3.8', '3.11', '3.12'] @@ -56,13 +56,13 @@ jobs: env: BIN: ${{ matrix.os == 'windows-latest' && 'Scripts' || 'bin' }} run: | - python -m venv .venv + python3 -m pip install uv + uv venv -p ${{ matrix.python-version }} echo "$GITHUB_WORKSPACE/.venv/$BIN" >> $GITHUB_PATH echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV - name: Install Python dependencies run: | - pip install uv uv pip install -r requirements.txt -r requirements_test.txt - name: Set up Rust @@ -72,9 +72,16 @@ jobs: uses: Swatinem/rust-cache@v2 with: save-if: ${{ github.ref_name == 'uPPPP' }} + + # Cache HDF5 + - uses: awalsh128/cache-apt-pkgs-action@latest + name: Cache apt packages + with: + packages: libhdf5-dev + version: 1.0 - name: Install up4 - run: pip install . + run: uv pip install . # TODO add doctests # - name: Run doctests @@ -83,7 +90,9 @@ jobs: # python tests/docs/run_doctest.py - name: Run tests - run: python3 -m pytest tests/test_all.py + env: + BIN: ${{ matrix.os == 'windows-latest' && 'Scripts/python.exe' || 'bin/python' }} + run: $VIRTUAL_ENV/$BIN -m pytest tests/test_all.py - name: Trigger docs build and deploy uses: peter-evans/repository-dispatch@v3