Skip to content

Commit

Permalink
Merge pull request #32 from EliahKagan/granular-steps
Browse files Browse the repository at this point in the history
Split CI jobs into more steps for clearer output
  • Loading branch information
bazingagin authored Aug 2, 2023
2 parents a78abc5 + 5553fbb commit 725c1cb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 27 deletions.
29 changes: 15 additions & 14 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,35 @@ jobs:
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v3
- name: Check out repository
uses: actions/checkout@v3

- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.9"

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry --version
run: curl -sSL https://install.python-poetry.org | python3 -

- name: Show Poetry version
run: poetry --version

- name: Install project and dependencies
run: poetry install

- name: Run Tests
run: |
poetry install
poetry run pytest --junit-xml=junit/test-results-3.9.xml
run: poetry run pytest --junit-xml=junit/test-results-3.9.xml

- name: Upload pytest test results
if: ${{ !cancelled() }} # Upload results even if tests fail.
uses: actions/upload-artifact@v3
with:
name: pytest-results-3.9
path: junit/test-results-3.9.xml

- name: Poetry Build
run: |
poetry build
- name: Build Package
run: poetry build

- name: pypi-publish
- name: Publish Package
uses: pypa/gh-action-pypi-publish@v1.8.8

27 changes: 14 additions & 13 deletions .github/workflows/test-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,36 @@ name: Run npc_gzip tests
on: [push, pull_request]

jobs:

run-tests:

run-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Check out repository
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry --version
run: curl -sSL https://install.python-poetry.org | python3 -

- name: Show Poetry version
run: poetry --version

- name: Install project and dependencies
run: poetry install

- name: Run Tests
run: |
poetry install
poetry run pytest --junit-xml=junit/test-results-${{ matrix.python-version }}.xml
run: poetry run pytest --junit-xml=junit/test-results-${{ matrix.python-version }}.xml

- name: Upload pytest test results
- name: Upload pytest test results
if: ${{ !cancelled() }} # Upload results even if tests fail.
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.python-version }}
path: junit/test-results-${{ matrix.python-version }}.xml
path: junit/test-results-${{ matrix.python-version }}.xml

0 comments on commit 725c1cb

Please # to comment.