I just don't know anymore #25
Workflow file for this run
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
name: Package Test and Deploy | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- run: pip install --upgrade pip build | |
- run: pip install -r requirements/common.txt | |
- run: python -m build --sdist --wheel | |
- run: pip install . | |
- run: pip uninstall -y montepy | |
- run: pip install --user dist/*.whl | |
- run: pip uninstall -y montepy | |
- run: pip install --user dist/*.tar.gz | |
- run: pip install --user montepy[test] | |
- run: pip install --user montepy[doc] | |
- run: pip freeze | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build | |
path: dist/* | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- run: pip install --user -r requirements/dev.txt | |
- run: coverage run -m pytest --junitxml=test_report.xml | |
- run: coverage report | |
- run: coverage xml | |
- name: Upload test report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test | |
path: test_report.xml | |
- name: Upload coverage report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage | |
path: coverage.xml | |
doc-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- run: pip install montepy[doc] | |
- run: sphinx-build doc/source/ doc/build/ -W --keep-going -E | |
- run: sphinx-build -b html doc/source/ doc/build/html | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: website | |
path: doc/build/html | |
format-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- run: pip install --user -r requirements/dev.txt | |
- run: black --check montepy/ tests/ | |
deploy-pages: | |
needs: [build, test, doc-test, format-test] | |
permissions: | |
contents: read | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Configure git | |
env: | |
TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
run: git config --global url."https://${TOKEN}:x-oauth-basic@github.com/".insteadOf "https://github.com/" | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- run: pip install --user montepy[doc] | |
- run: cd doc && make html | |
- run: tar -czf deploy-pages.tar.gz doc/build/html/* | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: deploy-pages | |
path: deploy-pages.tar.gz | |
- uses: actions/deploy-pages@v4 | |
with: | |
path: doc/build/html/* | |
deploy-pypi: | |
needs: [deploy-pages] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- run: pip install --user build | |
- run: python -m build --sdist --wheel . | |