Skip to content

Commit

Permalink
Merge pull request #119 from snok/fix-workflows
Browse files Browse the repository at this point in the history
Clean up workflows
  • Loading branch information
sondrelg authored Feb 12, 2023
2 parents 9948f04 + 0453357 commit 773ba01
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 381 deletions.
70 changes: 10 additions & 60 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ defaults:
shell: bash

jobs:

# Make sure the action works using the default settings
test-install:
name: default ${{ matrix.poetry-version }} ${{ matrix.os }} ${{ matrix.python-version }}
Expand All @@ -16,7 +15,7 @@ jobs:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
poetry-version: [ "1.1.14", "1.2.2" ]
poetry-version: [ "1.1.15", "1.2.2", "1.3.2" ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand All @@ -31,7 +30,6 @@ jobs:
poetry install --no-interaction
poetry run pytest --version
# Make sure the action sets config options correctly
test-config-options:
name: non-standard config - ${{ matrix.os }} ${{ matrix.python-version }}
Expand All @@ -48,49 +46,18 @@ jobs:
python-version: "${{ matrix.python-version }}"
- uses: ./
with:
version: 1.2.1
version: 1.3.2
virtualenvs-create: false
virtualenvs-in-project: true
virtualenvs-path: ~/.cache/test
installer-parallel: false
- run: |
source .github/scripts/assert.sh
assert_in "1.2.1" "$(poetry --version)"
assert_in "false" "$(poetry config virtualenvs.create)"
assert_in "true" "$(poetry config virtualenvs.in-project)"
assert_in "test" "$(poetry config virtualenvs.path)"
assert_in "false" "$(poetry config installer.parallel)"
# Make sure that install dir matches expectations
test-venv-in-project:
name: Check in-project install dir - ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: ./
with:
virtualenvs-in-project: true
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- run: |
source .github/scripts/assert.sh
echo "Test actual installation directory matches expectations"
output="$(poetry install)"
assert_in "/install-poetry/install-poetry/.venv" "$output"
echo "..and test that we can source the dir, just to double check"
source $VENV
pytest --version
assert_in "1.3.2" "$(poetry --version)"
assert_in "false" "$(poetry config virtualenvs.create)"
assert_in "true" "$(poetry config virtualenvs.in-project)"
assert_in "test" "$(poetry config virtualenvs.path)"
assert_in "false" "$(poetry config installer.parallel)"
# Check that installation-arguments works
test-installation-arguments:
Expand All @@ -104,23 +71,20 @@ jobs:
source .github/scripts/assert.sh
assert_in "1.1.9" "$(poetry --version)"
# Retrieve latest poetry version from PyPI
# Retrieve the latest poetry version from PyPI
check-latest:
runs-on: ubuntu-latest
outputs:
latest-poetry-version: ${{ steps.fetch.outputs.version }}
steps:
- name: Fetch latest Poetry version from PyPI
- name: Fetch the latest Poetry version from PyPI
id: fetch
run: |
curl -sf 'https://pypi.org/pypi/poetry/json' \
| jq -r '"version=" + .info.version' \
>> $GITHUB_OUTPUT
# Make sure the the action installs the latest version by default
# Make sure the action installs the latest version by default
test-latest-version-when-unspecified:
needs: check-latest
runs-on: ubuntu-latest
Expand All @@ -132,24 +96,10 @@ jobs:
assert_in "." "${{ needs.check-latest.outputs.latest-poetry-version }}"
assert_in "${{ needs.check-latest.outputs.latest-poetry-version }}" "$(poetry --version)"
# Make sure we're able to run the action with both major and minor versions
test-major-and-minor-versions:
runs-on: ubuntu-latest
steps:
- uses: snok/install-poetry@v1
- uses: snok/install-poetry@v1.1
- uses: snok/install-poetry@v1.2

# Legacy: make sure old scripts are not deleted
# The scripts folder contains scripts that are fetched by older versions of the
# action. They're unfortunately fetched from the main branch.
# If we delete these scripts, those versions of the action will fail.
test-scripts-exist:
runs-on: ubuntu-latest
steps:
# v1.1 script loaded in < 1.1.4
- uses: snok/install-poetry@v1.1.4
# v1.2 script loaded in > 1.1.4
- uses: snok/install-poetry@v1.1.6
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-merge-conflict
- id: check-case-conflict
Expand All @@ -10,7 +10,7 @@ repos:
- id: mixed-line-ending

- repo: https://github.com/sirosen/check-jsonschema
rev: 0.18.3
rev: 0.21.0
hooks:
- id: check-github-actions
- id: check-github-workflows
Expand Down
207 changes: 0 additions & 207 deletions poetry.lock

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/README.md

This file was deleted.

Loading

0 comments on commit 773ba01

Please sign in to comment.