-
Notifications
You must be signed in to change notification settings - Fork 6
Migrate to github actions #214
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,31 @@ | ||
| name: 'Initialize' | ||
| description: 'Checkout repo and install dependencies' | ||
| inputs: | ||
| latest: | ||
| description: 'If true, ignore requirements.txt and the versions pinned there.' | ||
| default: 'false' | ||
| documentation: | ||
| description: 'If true, install documentation build frameworks.' | ||
| default: 'false' | ||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Check out repository code | ||
| uses: actions/checkout@v4 | ||
| - name: Upgrade pip | ||
| run: python -m pip install --upgrade pip | ||
| shell: bash | ||
| - name: Install minimum-version runtime dependencies + GEMD | ||
| run: python -m pip install --only-binary ':all:' -r requirements.txt | ||
| shell: bash | ||
| if: ${{ inputs.latest == 'false' }} | ||
| - name: Install test dependencies | ||
| run: python -m pip install --only-binary ':all:' -r test_requirements.txt | ||
| shell: bash | ||
| - name: Install documentation building framework | ||
| run: python -m pip install --only-binary ':all:' -r doc_requirements.txt | ||
| shell: bash | ||
| if: ${{ inputs.documentation == 'true' }} | ||
| - name: Install gemd-python, along with the latest version of any outstanding dependencies | ||
| run: python -m pip install --only-binary ':all:' -e . | ||
| shell: bash |
This file contains hidden or 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,18 @@ | ||
| # GEMD Python PR | ||
|
|
||
| ## Description | ||
| Please briefly explain the goal of the changes/this PR. | ||
| The reviewer should be able to understand why the change is being made by reading this description | ||
| and its links (e.g. JIRA tickets). | ||
|
|
||
| ### PR Type: | ||
| - [ ] Breaking change (fix or feature that would cause existing functionality to change) | ||
| - [ ] Bug fix (non-breaking change which fixes an issue) | ||
| - [ ] New feature (non-breaking change which adds functionality) | ||
| - [ ] Maintenance (non-breaking change to assist developers) | ||
|
|
||
| ### Adherence to team decisions | ||
| - [ ] I have added tests for 100% coverage | ||
| - [ ] I have written Numpy-style docstrings for every method and class. | ||
| - [ ] I have communicated the downstream consequences of the PR to others. | ||
| - [ ] I have bumped the version in __version\__.py |
This file contains hidden or 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,43 @@ | ||
| name: Build and Deploy Docs | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
|
|
||
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
| concurrency: | ||
| group: "pages" | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| deploy: | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v1 | ||
| - name: Initialize the environment | ||
| uses: ./.github/actions/initialize | ||
| with: | ||
| documentation: 'true' | ||
| - name: Build Docs | ||
| run: | | ||
| make -C docs/ html | ||
| touch docs/_build/html/.nojekyll | ||
| - name: Upload artifact | ||
| uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: 'docs/_build/html' | ||
| - name: Setup Pages | ||
| uses: actions/configure-pages@v4 | ||
| - name: Deploy to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v4 |
This file contains hidden or 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,19 @@ | ||
| name: Deploy to PyPI | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| jobs: | ||
| publish: | ||
| name: Publish package to PyPI | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out repository code | ||
| uses: actions/checkout@v4 | ||
| - name: Build | ||
| run: python setup.py sdist bdist_wheel | ||
| - name: Publish | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains hidden or 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,48 @@ | ||
| name: PR Checks | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - 'release/**' | ||
|
|
||
| jobs: | ||
| check-version: | ||
| name: Check version bumped | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Initialize the environment | ||
| uses: ./.github/actions/initialize | ||
| - name: Check version | ||
| run: python scripts/validate_version_bump.py | ||
| linting: | ||
| name: Run linting with flake8 | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Initialize the environment | ||
| uses: ./.github/actions/initialize | ||
| - name: Lint the source directory | ||
| run: flake8 gemd | ||
| check-deprecated: | ||
| name: Find code marked for removal in this version | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Initialize the environment | ||
| uses: ./.github/actions/initialize | ||
| - name: Deprecated check | ||
| run: derp . gemd/__version__.py | ||
| check-docs: | ||
| name: Check docs for warnings | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Initialize the environment | ||
| uses: ./.github/actions/initialize | ||
| with: | ||
| documentation: 'true' | ||
| - name: Build Docs | ||
| continue-on-error: true | ||
| run: make -C docs/ html SPHINXOPTS='-W --keep-going' |
This file contains hidden or 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,48 @@ | ||
| name: PR Tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - 'release/**' | ||
|
|
||
| jobs: | ||
| run-tests: | ||
| name: Execute unit tests | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
| steps: | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - uses: actions/checkout@v4 | ||
| - name: Initialize the environment | ||
| uses: ./.github/actions/initialize | ||
| - name: Execute unit tests | ||
| run: pytest --cov=gemd --cov-report term-missing:skip-covered --cov-config=tox.ini --no-cov-on-fail --cov-fail-under=100 tests/ | ||
| run-tests-against-latest: | ||
| # These runs are intended to confirm the latest minor version of our dependencies we claim to | ||
| # support don't break with our latest changes. Since they're not the versions we directly state | ||
| # you should use (i.e. in requirements.txt), they arguably aren't critical, hence not blocking. | ||
| name: Non-blocking - Execute unit tests against latest version of dependencies | ||
| runs-on: ubuntu-latest | ||
| continue-on-error: true | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
| steps: | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - uses: actions/checkout@v4 | ||
| - name: Initialize the environment | ||
| uses: ./.github/actions/initialize | ||
| with: | ||
| latest: 'true' | ||
| - name: Execute unit tests | ||
| run: pytest tests/ | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| __version__ = "2.1.1" | ||
| __version__ = "2.1.2" |
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.