Skip to content

Commit

Permalink
👷 update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
techouse committed Apr 28, 2024
1 parent 867c82e commit 7f837b5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ defaults:
permissions: read-all

jobs:
test:
uses: ./.github/workflows/test.yml
secrets: inherit
build-and-publish:
needs: test
name: "Build & Publish"
runs-on: ubuntu-latest
environment:
name: pypi
Expand Down Expand Up @@ -44,25 +49,20 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: "pip"
- name: Install build dependencies
id: install_build_dependencies
run: |
set -e
python3 -m pip install --upgrade pip
pip install build setuptools wheel
run: pip install build setuptools wheel
- name: Build a binary wheel and a source tarball
id: build
run: |
set -e
python3 -m build --sdist --wheel --outdir dist/ .
run: python -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution package to PyPI
id: publish
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
- name: Install pyproject-parser
id: install_pyproject_parser
run: |
set -e
pip install pyproject-parser[cli]
- name: Read project name from pyproject.toml
id: read_project_name
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@ on:
pull_request:
branches:
- main
workflow_call:
defaults:
run:
shell: bash
permissions: read-all

jobs:
analyze:
name: "Test"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: "pip"
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install -r requirements_dev.txt
run: pip install -r requirements_dev.txt
- name: Run static analysis
run: tox -e linters
test:
Expand Down Expand Up @@ -53,6 +54,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
cache: "pip"
- uses: actions/cache@v4
with:
path: ~/.cache/pip
Expand All @@ -61,8 +63,7 @@ jobs:
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -U codecov tox-gh-actions
pip install -U codecov tox-gh-actions
pip install -r requirements_dev.txt
- name: Test with tox
run: tox
Expand Down

0 comments on commit 7f837b5

Please sign in to comment.