Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test pypi github action #32

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 43 additions & 10 deletions .github/workflows/deploy-test-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,53 @@
name: Publish to TestPyPI

on:
workflow_run:
workflows: ["Run Unit Tests"]
branches: ['release/*.*.*']
types: ["completed"]
# trigger on pull requests
pull_request:

workflow_dispatch:

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
build-test-publish-to-testpypi:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: ./.github/workflows/publish-packages.yml
with:
upload_to_test: true
branch: ${{ github.event.workflow_run.head_branch }}
build:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
# We must explicitly install the requirements so that we can force
# installation of the local wheel below in case the version conflicts
# with published wheels (typically only possible during testing).
python -m pip install \
-r requirements/requirements-build.txt \
-r requirements/requirements.txt \
-r requirements/requirements-testing.txt

- name: Install pypa/build
run:
python -m pip install build
- name: Build a binary wheel and a source tarball
run:
python -m build --outdir dist/ .
- name: Install wheel
run:
python -m pip install dupin --progress-bar off --no-index -f dist/
- name: Test with pytest
run:
python -m pytest -v tests/

- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
58 changes: 0 additions & 58 deletions .github/workflows/publish-packages.yml

This file was deleted.

Loading