-
Notifications
You must be signed in to change notification settings - Fork 0
Migrate project from company GitLab to GitHub #1
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| # GitHub Actions workflow to build, test and publish Python packages to PyPI everytime a new release is created. | ||
|
|
||
| name: Publish release | ||
|
|
||
| on: | ||
| release: | ||
| types: | ||
| - published | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build package | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| # We use Python 3.8 here because it's the minimum Python version supported by this library. | ||
| - name: Setup Python 3.8 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: 3.8 | ||
|
|
||
| - name: Install dependencies | ||
| run: pip install --upgrade pip build | ||
|
|
||
| - name: Build package | ||
| run: python -m build | ||
|
|
||
| - name: Upload build artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: dist_packages | ||
| path: dist/ | ||
|
|
||
| test: | ||
| # This job tests the built package by installing it via pip and running unit tests (without tox). | ||
| name: Test package | ||
| needs: build | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Python 3.8 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: 3.8 | ||
|
|
||
| - name: Download build artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: dist_packages | ||
| path: dist/ | ||
|
|
||
| - name: Install built package with testing dependencies | ||
| run: pip install "$(find dist/ -name 'validataclass-search-queries-*.whl')[testing]" | ||
|
|
||
| - name: Run unit tests | ||
| run: python -m pytest | ||
|
|
||
| publish: | ||
| name: Publish package | ||
| needs: test | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| steps: | ||
| - name: Download build artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: dist_packages | ||
| path: dist/ | ||
|
|
||
| - name: Upload package to GitHub release assets | ||
| uses: AButler/upload-release-assets@v3.0 | ||
| with: | ||
| files: dist/* | ||
| repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Publish package to PyPI | ||
| uses: pypa/gh-action-pypi-publish@v1.12.4 | ||
| with: | ||
| user: __token__ | ||
| password: ${{ secrets.PYPI_API_TOKEN }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| # GitHub Actions workflow for running unit tests (using tox, pytest and flake8) on each push or pull request to main. | ||
|
|
||
| name: Unit tests | ||
|
|
||
| # TODO: Remove dev-mypy after merging it into main. | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - dev-mypy | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - dev-mypy | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Run unit tests (Python ${{ matrix.python-version }}, SQLAlchemy ${{ matrix.sqlalchemy-version }}) | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: | ||
| - '3.8' | ||
| - '3.9' | ||
| - '3.10' | ||
| - '3.11' | ||
| - '3.12' | ||
| sqlalchemy-version: | ||
| - '1.4' | ||
| - '2.0' | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install dependencies | ||
| run: pip install --upgrade pip tox | ||
|
|
||
| - name: Run test suite with tox | ||
| # Run tox using the version of Python in `PATH` | ||
| run: tox run -e clean,py-sqlalchemy${{ matrix.sqlalchemy-version }},report,flake8 -- --junit-xml=reports/pytest_${{ matrix.python-version }}_sqlalchemy${{ matrix.sqlalchemy-version }}.xml | ||
|
|
||
| - name: Upload test result artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| if: success() || failure() | ||
| with: | ||
| name: pytest-results-${{ matrix.python-version }}-sqlalchemy${{ matrix.sqlalchemy-version }} | ||
| path: reports/pytest_${{ matrix.python-version }}_sqlalchemy${{ matrix.sqlalchemy-version }}.xml | ||
|
|
||
| report: | ||
| name: Publish unit test reports | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| # Job depends on test results | ||
| needs: test | ||
|
|
||
| # Do not run this job in pull requests from a forked repository (because the test-reporter would fail) | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Download test result artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| path: reports/ | ||
| pattern: pytest-results-* | ||
| merge-multiple: true | ||
|
|
||
| - name: Publish unit test reports | ||
| uses: dorny/test-reporter@v2.1.1 | ||
| if: success() || failure() | ||
| with: | ||
| name: Pytest Report | ||
| path: reports/pytest_*.xml | ||
| reporter: java-junit |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.