-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,12 @@ | ||
version: 2 | ||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
# Keep Python dependencies updated | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
This file contains 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,14 @@ | ||
name: pre-commit | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
- uses: pre-commit/[email protected] |
This file contains 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,36 @@ | ||
name: release-pipeline | ||
|
||
on: | ||
release: | ||
types: | ||
- created | ||
|
||
|
||
jobs: | ||
release-job: | ||
runs-on: ubuntu-latest | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Build package | ||
run: | | ||
pip install twine wheel | ||
python setup.py bdist_wheel | ||
- name: Check version number match | ||
run: | | ||
echo "GITHUB_REF: ${GITHUB_REF}" | ||
# Make sure the package version is the same as the tag | ||
grep -Rq "^Version: ${GITHUB_REF:11}$" peak_performance.egg-info/PKG-INFO | ||
- name: Publish to PyPI | ||
run: | | ||
twine check dist/* | ||
twine upload --repository pypi --username __token__ --password ${PYPI_TOKEN} dist/* | ||
- name: Test installation | ||
run: | | ||
sleep 120 | ||
pip install peak_performance==${GITHUB_REF:11} |
This file contains 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,36 @@ | ||
name: pipeline | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
test-job: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.10", "3.11"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
pip install -e .[test] | ||
- name: Run tests | ||
run: | | ||
pytest -v --cov-report xml --cov=peak_performance --cov-report term-missing peak_performance | ||
- name: Upload coverage | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
file: ./coverage.xml | ||
- name: Test Wheel build, install and import | ||
run: | | ||
python setup.py bdist_wheel | ||
twine check dist/* | ||
cd dist | ||
pip install peak_performance*.whl | ||
python -c "import peak_performance; print(peak_performance.__version__)" |