-
Notifications
You must be signed in to change notification settings - Fork 3
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 #9 from cfs-energy/patch39
Ensure project works for Python 3.9
- Loading branch information
Showing
9 changed files
with
177 additions
and
53 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,97 @@ | ||
# Largely based on https://github.com/cfs-energy/cfspopcon/blob/main/.github/workflows/workflow_actions.yml | ||
# This workflow will install Python dependencies and run tests | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: workflow_actions | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the "main" branch | ||
pull_request: [] | ||
push: | ||
tags: | ||
- '*' | ||
branches: | ||
- 'main' | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
tag: "Manual run" | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.9', '3.10', '3.11'] # should test the versions we allow for in pyproject.toml | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Poetry | ||
run: curl -sSL https://install.python-poetry.org | python - --version 1.8.2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'poetry' | ||
|
||
- name: Setup | ||
run: poetry install | ||
|
||
- name: Tests | ||
run: MPLBACKEND=Agg poetry run pytest tests | ||
|
||
- name: Test package | ||
run: | | ||
poetry build -f wheel | ||
python -m venv test_env | ||
source ./test_env/bin/activate | ||
pip install $(find ./dist -name "*.whl") | ||
# enter tempdir so import cfspopcon doesn't find the cfspopcon directory | ||
mkdir tmp_dir && cd tmp_dir | ||
MPLBACKEND=Agg radas_config -o ./new_config.yaml | ||
MPLBACKEND=Agg radas -s hydrogen -c ./new_config.yaml | ||
# build_release: | ||
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
# needs: build | ||
# runs-on: ubuntu-22.04 | ||
|
||
# steps: | ||
# - uses: actions/checkout@v3 | ||
|
||
# - name: Install Poetry | ||
# run: curl -sSL https://install.python-poetry.org | python - --version 1.8.2 | ||
|
||
# - name: Poetry build | ||
# run: poetry build | ||
|
||
# - uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: pypi-build | ||
# path: ./dist | ||
|
||
# publish: | ||
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
# needs: build_release | ||
# runs-on: ubuntu-22.04 | ||
# environment: | ||
# name: pypi-publish | ||
# url: https://pypi.org/project/cfspopcon/ | ||
# permissions: | ||
# id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
# steps: | ||
# - uses: actions/download-artifact@v3 | ||
|
||
# - name: Publish package distributions to PyPI | ||
# uses: pypa/gh-action-pypi-publish@release/v1 | ||
# with: | ||
# packages-dir: pypi-build/ | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Empty file.
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