Skip to content

Commit

Permalink
Update test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilchibber authored Sep 23, 2024
1 parent 0e82309 commit 55861f7
Showing 1 changed file with 24 additions and 29 deletions.
53 changes: 24 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,35 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v26
# Set up Python 3.12.5
- name: Set up Python 3.12.5
uses: actions/setup-python@v4
with:
# Ensure Nix is installed in multi-user mode
nix_path: nixpkgs=channel:nixpkgs-unstable
install_url: https://nixos.org/nix/install
python-version: 3.12.5

- uses: cachix/cachix-action@v14
with:
name: devenv

# Diagnostic Steps
- name: List Installed Packages
run: poetry run pip list

- name: Print sys.path
run: poetry run python -c "import sys; print(sys.path)"
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Print Current Working Directory
run: pwd
- name: Cache Poetry dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: List Directory Contents
run: ls -la
- name: Update Poetry Lock File
run: poetry lock --no-update

- name: Find numpy in Site-Packages
run: find $(python -c "import site; print(site.getsitepackages()[0])") -name "numpy*"
- name: Install Dependencies
run: poetry install --no-interaction --no-ansi

- name: Print numpy Location
run: poetry run python -c "import numpy; print(numpy.__file__)"
# Ensure test.sh can be executed - Using absolute path
- name: Make test.sh Executable
run: chmod +x $GITHUB_WORKSPACE/.test.sh

# Run the test.sh script using absolute path
- name: Run Tests
run: poetry run pytest

- name: Install devenv
run: nix profile install nixpkgs#devenv

- name: Build the devenv shell and run any pre-commit hooks
run: devenv test
run: poetry run $GITHUB_WORKSPACE/.test.sh

0 comments on commit 55861f7

Please sign in to comment.