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

Improving CI/CD for Github actions #336

Merged
merged 65 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
bac71c7
Deleted all gitlab CI work.
MicahGale Jan 21, 2024
6a14b71
Removed pytest.ini
MicahGale Jan 21, 2024
4846286
Moved all requirements to pypyroject.toml
MicahGale Jan 21, 2024
4c33d4a
Updated actions to not use requirements anymore.
MicahGale Jan 21, 2024
bf175fd
Fixed bad maintainers.
MicahGale Jan 21, 2024
0eef2c1
Relaxed black requirement.
MicahGale Jan 21, 2024
d166e43
Had pip defer to local for installing.
MicahGale Jan 21, 2024
373cfac
Correct setuptools-scm dependency
MicahGale Jan 21, 2024
88ad4f8
Ignoring version file from setuptools_scm
MicahGale Jan 21, 2024
9fb3b12
Implemented Coveralls with a lot of trial and error.
MicahGale Jan 21, 2024
4f1c6b6
Deleted all gitlab CI work.
MicahGale Jan 21, 2024
5bd8051
Removed pytest.ini
MicahGale Jan 21, 2024
5549e76
Moved all requirements to pypyroject.toml
MicahGale Jan 21, 2024
9b3e70e
Updated actions to not use requirements anymore.
MicahGale Jan 21, 2024
a80b73d
Fixed bad maintainers.
MicahGale Jan 21, 2024
987350b
Relaxed black requirement.
MicahGale Jan 21, 2024
0bba820
Had pip defer to local for installing.
MicahGale Jan 21, 2024
c836d61
Correct setuptools-scm dependency
MicahGale Jan 21, 2024
044ae17
Ignoring version file from setuptools_scm
MicahGale Jan 21, 2024
cea9453
Implemented Coveralls with a lot of trial and error.
MicahGale Jan 21, 2024
fbcc3a7
Ignore _version from coverage.
MicahGale Jan 21, 2024
b0cf2df
Limited coveralls to coverage.xml only.P
MicahGale Jan 21, 2024
196ef9b
Added basic badges
MicahGale Jan 21, 2024
53af432
First try with using test reporter.
MicahGale Jan 21, 2024
907c082
Added name to test reporter.
MicahGale Jan 21, 2024
e23c441
Added reporter to test reporter.
MicahGale Jan 21, 2024
2ec0bcd
Made test names more meaningful.
MicahGale Jan 21, 2024
b6a28b0
Merge branch 'develop' into all-in-cd
MicahGale Jan 21, 2024
02b9a9c
Merge pull request #2 from MicahGale/all-in-cd
MicahGale Jan 21, 2024
1656936
Actually implemented a build and deploy phase
MicahGale Jan 21, 2024
fd6c1a7
Merge pull request #4 from MicahGale/develop
MicahGale Jan 21, 2024
be49ab7
Cleaned up pypi deploy
MicahGale Jan 21, 2024
1d0136a
Switched version system fully over to Setuptools-scm
MicahGale Jan 21, 2024
0823e03
Made a version command line argument.
MicahGale Jan 21, 2024
ce33238
Switched to having GHA automatically change version numbers.
MicahGale Jan 21, 2024
b2482dd
Made GHA create automatic releases.
MicahGale Jan 21, 2024
fc06ee3
Created pull request template
MicahGale Jan 22, 2024
7019777
Added documentation on how versioning now works.
MicahGale Jan 25, 2024
caf2d81
Switched run to on pull_request to allow running on fork
MicahGale Jan 25, 2024
85af4cf
Reformatted code with black.
MicahGale Jan 25, 2024
314838f
Updated permissions for test reporter.
MicahGale Jan 25, 2024
1a3f878
Tried to actually set permissions.
MicahGale Jan 25, 2024
f54bec6
Tried yolo permissions
MicahGale Jan 25, 2024
b9b9fba
Revert "Updated permissions for test reporter."
MicahGale Jan 25, 2024
983087d
Fixed bad grammar.
MicahGale Feb 1, 2024
71a9847
Added DOI to code.
MicahGale Feb 1, 2024
0df59d1
Created test script for finding missing documentation.
MicahGale Feb 1, 2024
7a40593
Ran test as part of doc test.
MicahGale Feb 1, 2024
2400a8a
Fixed bug with how __init__ was treated.
MicahGale Feb 1, 2024
b742834
Updated version of black
MicahGale Feb 1, 2024
d694d0e
Added missing documentation files.
MicahGale Feb 1, 2024
80b370a
Ignored private file.
MicahGale Feb 1, 2024
4a413aa
Actually added new files to the TOC.
MicahGale Feb 1, 2024
508f932
Tried to get cd to persist
MicahGale Feb 1, 2024
04f30d4
Fixed syntax.
MicahGale Feb 1, 2024
c9ebe70
Named missing api test
MicahGale Feb 1, 2024
108018f
Get that good SEO.
MicahGale Feb 1, 2024
f4032f3
Updated test to run after merge for protected branches
MicahGale Feb 4, 2024
8bfe485
Update bug_report.md to prompt users to do the right thing
MicahGale Feb 6, 2024
2d5f2cd
Merge branch 'develop' into main
MicahGale Feb 13, 2024
d7e7de6
Removed unused vars.
MicahGale Feb 5, 2024
65a463b
Fixed typo with bug reports labels.
MicahGale Feb 5, 2024
0c5f3e2
Switched to implicit sys.argv.
MicahGale Feb 5, 2024
0d7fbe6
Removed unecessary check.
MicahGale Feb 5, 2024
bfbd0c9
Removed dubplicate TOC entry for input_file.
MicahGale Feb 13, 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
21 changes: 21 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--
If you are a first-time contributor to MontePy,
refer the developing guidelines at:
https://idaholab.github.io/MontePy/developing.html
-->

# Description

Please include a summary of the change and which issue is fixed if applicable. Please also include relevant motivation and context.

Fixes # (issue)

# Checklist

- [ ] I have performed a self-review of my own code
- [ ] I have made corresponding changes to the documentation (if applicable)
- [ ] I have added tests that prove my fix is effective or that my feature works (if applicable)
<!--
While tests will automatically be checked by CI, it is good practice to
ensure that they pass locally first.
-->
83 changes: 68 additions & 15 deletions .github/workflows/deploy.yml
MicahGale marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches: [main]

env:
RELEASE_LEVEL: patch

MicahGale marked this conversation as resolved.
Show resolved Hide resolved
jobs:
last-minute-test:
runs-on: ubuntu-latest
Expand All @@ -13,13 +16,12 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.8
- run: pip install --user -r requirements/dev.txt
- run: pip install . montepy[develop]
- run: python -m pytest

build-pages:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Configure git
Expand All @@ -30,13 +32,67 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: 3.8
- run: pip install --user montepy[doc]
- 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/

build-packages:
name: Build, sign, and release packages on github
runs-on: ubuntu-latest
needs: [last-minute-test]
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: set up python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- run: pip install . montepy[build]
- name: GitHub Actions Create Tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# ensure tags are up to date
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- run: python -m build .
- name: Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@v2.1.1
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
draft: true
- run: >-
gh release upload
'${{ steps.tag_version.outputs.new_tag }}' dist/**
--repo '${{ github.repository }}'
- uses: actions/upload-artifact@v4
with:
name: build
path: |
dist/*.tar.gz
dist/*.whl

deploy-pages:
permissions:
Expand Down Expand Up @@ -65,18 +121,16 @@ jobs:
environment:
name: test-pypi
url: https://test.pypi.org/p/montepy # Replace <package-name> with your PyPI project name
needs: [deploy-pages]
needs: [deploy-pages, build-packages]
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/download-artifact@v4
with:
python-version: 3.8
- run: python -m pip install build
- run: python -m build --sdist --wheel
name: build
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand All @@ -86,20 +140,19 @@ jobs:
environment:
name: pypi
url: https://pypi.org/p/montepy # Replace <package-name> with your PyPI project name
needs: [deploy-pages, deploy-test-pypi]
needs: [deploy-pages, deploy-test-pypi, build-packages]
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/download-artifact@v4
with:
python-version: 3.8
- run: python -m pip install build
- run: python -m build --sdist --wheel
name: build
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1




43 changes: 33 additions & 10 deletions .github/workflows/main.yml
MicahGale marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Test package
name: CI testing

on: [push]
on: [pull_request]

jobs:
build:
Expand All @@ -16,15 +16,18 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- run: pip install --upgrade pip build
- run: pip install -r requirements/common.txt
- run: pip install build
- 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 install --user . montepy[test]
- run: pip install --user . montepy[doc]
- run: pip install --user . montepy[format]
- run: pip install --user . montepy[build]
- run: pip install --user . montepy[develop]
- run: pip freeze
- name: Upload build artifacts
uses: actions/upload-artifact@v3
Expand All @@ -34,6 +37,7 @@ jobs:

test:
runs-on: ubuntu-latest
permissions: write-all
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
Expand All @@ -44,20 +48,35 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: pip install --user -r requirements/dev.txt
- run: pip install --user . montepy[test]
- run: coverage run -m pytest --junitxml=test_report.xml
- run: coverage report
- run: coverage xml
- name: Upload test report
uses: actions/upload-artifact@v3
if: ${{ matrix.python-version == '3.9' }}
uses: actions/upload-artifact@v4
with:
name: test
path: test_report.xml
- name: Upload coverage report
uses: actions/upload-artifact@v3
if: ${{ matrix.python-version == '3.9' }}
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.xml
- name: Test Reporter
if: ${{ matrix.python-version == '3.9' }}
uses: dorny/test-reporter@v1.7.0
with:
name: CI-test-report
path: test_report.xml
reporter: java-junit
- name: Coveralls GitHub Action
if: ${{ matrix.python-version == '3.9' }}
uses: coverallsapp/github-action@v2.2.3
with:
file: coverage.xml


doc-test:
runs-on: ubuntu-latest
Expand All @@ -68,13 +87,17 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.8
- run: pip install montepy[doc]
- 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
- name: Test for missing API documentation
run: |
cd doc/source
python _test_for_missing_docs.py

format-test:
runs-on: ubuntu-latest
Expand All @@ -85,7 +108,7 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.8
- run: pip install --user -r requirements/dev.txt
- run: pip install . montepy[format]
- run: black --check montepy/ tests/


1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ doc/build/*
.coverage
.idea/
.ipynb_checkpoints/
montepy/_version.py
Loading
Loading