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

Create Github Actions #2

Merged
merged 49 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
202132e
Create main.yml with build stage.
MicahGale Jan 10, 2024
bbbd863
Fixed typo in action
MicahGale Jan 10, 2024
790b97c
Fixed steps syntax
MicahGale Jan 10, 2024
c816dbf
Fixed more typos
MicahGale Jan 10, 2024
150fce4
Tried add simple test
MicahGale Jan 10, 2024
2a773fe
Tried to fix pip install
MicahGale Jan 10, 2024
19354e6
added coverage
MicahGale Jan 10, 2024
06371d3
Started deploy with building pages
MicahGale Jan 10, 2024
2898bb1
Update deploy.yml
MicahGale Jan 10, 2024
6108ee5
Update deploy.yml
MicahGale Jan 10, 2024
11e1606
Debugging failures
MicahGale Jan 10, 2024
69042c5
Update deploy.yml
MicahGale Jan 10, 2024
7212bd8
trying to get cd to stick
MicahGale Jan 10, 2024
b10116c
Trying to deploy to pages now
MicahGale Jan 10, 2024
6788324
Delete .github/workflows/deploy.yml
MicahGale Jan 10, 2024
f33fc6b
Added doc testing.
MicahGale Jan 10, 2024
9a855b3
Trying to fix montepy dep for doc
MicahGale Jan 10, 2024
3f35a59
Update main.yml
MicahGale Jan 10, 2024
a5ffdff
Tried to give git access to private repo
MicahGale Jan 10, 2024
819a05d
Tried to fix permissions and added deploy pypi
MicahGale Jan 10, 2024
2eaa938
Fixed uploading tar ball
MicahGale Jan 10, 2024
f7e8d96
Fixed deploy pages
MicahGale Jan 10, 2024
cf30e75
Trying to get artifacts happy
MicahGale Jan 10, 2024
2e7aa7e
Update main.yml
MicahGale Jan 10, 2024
191ccb9
I just don't know anymore
MicahGale Jan 10, 2024
4ffc9f4
Tried upload pages-artifact
MicahGale Jan 10, 2024
5d2eab2
Trying different path
MicahGale Jan 10, 2024
929b3f9
Forgot to delete path
MicahGale Jan 10, 2024
c637b9f
Trying rolling back version.
MicahGale Jan 10, 2024
681f84a
Trying with adding pages config
MicahGale Jan 10, 2024
629da91
Pages actually wants a path.
MicahGale Jan 10, 2024
7133f25
Tried splitting pages deploy into two jobs
MicahGale Jan 10, 2024
689ba4e
Tried naming step.
MicahGale Jan 10, 2024
5ad320a
Tried manually downloading artifacts.
MicahGale Jan 10, 2024
61486d0
Added pypi deploy and tried being explicit
MicahGale Jan 10, 2024
dd820c1
Fixed var name.
MicahGale Jan 10, 2024
e53e2c3
Try version 4 again.
MicahGale Jan 10, 2024
4be3146
fixed build artifact names.
MicahGale Jan 10, 2024
1517e37
Gave up on numbered builds.
MicahGale Jan 10, 2024
fe78968
I think you need to link dependent things to access artifacts.
MicahGale Jan 10, 2024
eea63ef
Just give up and recreate the artifacts again.
MicahGale Jan 10, 2024
e0df78a
Removed merge artifact.
MicahGale Jan 10, 2024
50e998d
Fixed flag error.
MicahGale Jan 10, 2024
191d7c2
Helps when you read the "mandatory" warning in the guide.
MicahGale Jan 10, 2024
63293e6
actually pointed at test.
MicahGale Jan 10, 2024
e9bc92d
Created normal pypi deploy process
MicahGale Jan 10, 2024
d71455a
Split deploy to separate workflow.
MicahGale Jan 10, 2024
53ad982
Removed deploy from test
MicahGale Jan 10, 2024
777116d
Reved version
MicahGale Jan 11, 2024
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
107 changes: 107 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Deploy

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
last-minute-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: python -m pytest

build-pages:
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
- uses: actions/configure-pages@v4
- uses: actions/upload-pages-artifact@v3
with:
name: deploy-pages
path: doc/build/html/

deploy-pages:
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 }}
needs: [build-pages, last-minute-test]
runs-on: ubuntu-latest
steps:
- run: ls -l
- uses: actions/download-artifact@v4
with:
name: deploy-pages
- run: ls -l
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: deploy-pages


deploy-test-pypi:
environment:
name: test-pypi
url: https://test.pypi.org/p/montepy # Replace <package-name> with your PyPI project name
needs: [deploy-pages]
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.8
- run: python -m pip install build
- run: python -m build --sdist --wheel
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

deploy-pypi:
environment:
name: pypi
url: https://pypi.org/p/montepy # Replace <package-name> with your PyPI project name
needs: [deploy-pages, deploy-test-pypi]
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.8
- run: python -m pip install build
- run: python -m build --sdist --wheel
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1



91 changes: 91 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Test package

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/


3 changes: 1 addition & 2 deletions montepy/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ def __init__(self, message):

class MalformedInputError(ValueError):
"""
<<<<<<< HEAD
Raised when there is an error with the MCNP input not related to the parser.
Raised when there is an error with the MCNP input not related to the parser.
"""

def __init__(self, input, message):
Expand Down