-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from Autostronomy/versionreqs
Refactor for better version control
- Loading branch information
Showing
18 changed files
with
565 additions
and
93 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,100 @@ | ||
name: CD | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
release: | ||
types: | ||
- published | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
FORCE_COLOR: 3 | ||
|
||
jobs: | ||
dist: | ||
name: Distribution build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Build sdist and wheel | ||
run: pipx run build | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: dist | ||
|
||
- name: Check products | ||
run: pipx run twine check dist/* | ||
|
||
test-built-dist: | ||
needs: [dist] | ||
name: Test built distribution | ||
runs-on: ubuntu-latest | ||
environment: deploy-testpypi | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/setup-python@v5 | ||
name: Install Python | ||
with: | ||
python-version: "3.10" | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: artifact | ||
path: dist | ||
- name: List contents of built dist | ||
run: | | ||
ls -ltrh | ||
ls -ltrh dist | ||
- name: Publish to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@v1.9.0 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
verbose: true | ||
skip-existing: true | ||
- name: Check test pypi packages | ||
run: | | ||
sleep 3 | ||
python -m pip install --upgrade pip | ||
echo "=== Testing wheel file ===" | ||
# Install wheel to get dependencies and check import | ||
python -m pip install --extra-index-url https://test.pypi.org/simple --upgrade --pre autoprof | ||
python -c "import autoprof; print(autoprof.__version__)" | ||
echo "=== Done testing wheel file ===" | ||
echo "=== Testing source tar file ===" | ||
# Install tar gz and check import | ||
python -m pip uninstall --yes autoprof | ||
python -m pip install --extra-index-url https://test.pypi.org/simple --upgrade --pre --no-binary=:all: autoprof | ||
python -c "import autoprof; print(autoprof.__version__)" | ||
echo "=== Done testing source tar file ===" | ||
publish: | ||
needs: [dist, test-built-dist] | ||
name: Publish to PyPI | ||
environment: deploy-pypi | ||
permissions: | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
|
||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- uses: pypa/gh-action-pypi-publish@v1.9.0 | ||
if: startsWith(github.ref, 'refs/tags') |
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,51 @@ | ||
name: Unit Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
- dev | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{matrix.os}} | ||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11"] | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Record State | ||
run: | | ||
pwd | ||
echo github.ref is: ${{ github.ref }} | ||
echo GITHUB_SHA is: $GITHUB_SHA | ||
echo github.event_name is: ${{ github.event_name }} | ||
pip --version | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest | ||
pip install wheel | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
shell: bash | ||
- name: Install AutoProf | ||
run: | | ||
cd $GITHUB_WORKSPACE/ | ||
pip install . | ||
pip show AutoProf | ||
shell: bash | ||
- name: Test with pytest | ||
run: | | ||
cd $GITHUB_WORKSPACE/tests/ | ||
pwd | ||
pytest -s | ||
shell: bash |
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
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
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
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
Oops, something went wrong.