diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index efb0ae6..937a14b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,6 +1,6 @@ name: Lint -on: [push, pull_request] +on: [push] concurrency: group: ${{ github.workflow }}-${{ github.ref_name }} @@ -13,9 +13,17 @@ env: jobs: pre-commit: runs-on: ubuntu-22.04 + container: + image: movesrwth/stormpy:ci-debug steps: - uses: actions/checkout@v4 + - name: Install dependencies + run: | + apt-get update + apt-get -y install curl + apt-get -y install git + - name: Configure Python uses: actions/setup-python@v5 with: @@ -28,19 +36,14 @@ jobs: virtualenvs-create: true virtualenvs-in-project: true - - name: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v4 - with: - path: .venv - key: venv-${{ runner.os }}-v1-${{ hashFiles('**/poetry.lock') }} + - name: Load existing venv + run: poetry env use /opt/venv/bin/python - name: Install dependencies - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: poetry install --no-root --only main,test + run: poetry install - - name: Install pre-commit - run: pip install pre-commit==${{ env.PRECOMMIT_VERSION }} + - name: Git thinks the directories are sus + run: git config --global --add safe.directory '*' - name: Cache pre-commit uses: actions/cache@v4 @@ -49,4 +52,4 @@ jobs: key: precommit-${{ hashFiles('.pre-commit-config.yaml') }} - name: Run pre-commit - run: pre-commit run --all-files + run: poetry run pre-commit run --all-files diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bb941fe..17ebae5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,6 @@ name: Test -on: [push, pull_request] +on: [push] concurrency: group: ${{ github.workflow }}-${{ github.ref_name }} @@ -13,9 +13,17 @@ env: jobs: test: runs-on: ubuntu-22.04 + container: + image: movesrwth/stormpy:ci-debug steps: - uses: actions/checkout@v4 + - name: Install dependencies + run: | + apt-get update + apt-get -y install curl + apt-get -y install git + - name: Configure Python uses: actions/setup-python@v5 with: @@ -28,16 +36,11 @@ jobs: virtualenvs-create: true virtualenvs-in-project: true - - name: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v4 - with: - path: .venv - key: venv-${{ runner.os }}-v1-${{ hashFiles('**/poetry.lock') }} + - name: Load existing venv + run: poetry env use /opt/venv/bin/python - name: Install dependencies - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: poetry install --no-root --only main,test + run: poetry install - - name: Install library - run: poetry install --only main,test + - name: Run tests + run: poetry run pytest