-
Notifications
You must be signed in to change notification settings - Fork 22
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 #30 from CapeLeidokos/feature/fix_python_package
Prepare packaging and split up github workflows
- Loading branch information
Showing
41 changed files
with
339 additions
and
151 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,24 @@ | ||
name: Check Python Code Format | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
format_checking: | ||
name: Check Python Formatting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Check files using the black formatter | ||
uses: rickstaa/action-black@v1 | ||
id: action_black | ||
with: | ||
black_args: "." | ||
- name: Annotate diff changes using reviewdog | ||
if: steps.action_black.outputs.is_formatted == 'true' | ||
uses: reviewdog/action-suggester@v1 | ||
with: | ||
tool_name: blackfmt |
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,24 @@ | ||
name: Lint README | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
lint_readme: | ||
name: Lint README | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: README.md Link Check | ||
uses: lycheeverse/[email protected] | ||
id: lychee_readme_md | ||
with: | ||
args: --verbose --no-progress "/github/workspace/README.md" | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
- name: Fail on README.md Link Check Errors | ||
run: exit ${{ steps.lychee_readme_md.outputs.exit_code }} |
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,24 @@ | ||
name: Lint generated HTML | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
lint: | ||
name: Lint generated HTML | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: HTML Link Check | ||
uses: lycheeverse/[email protected] | ||
id: lychee_html | ||
with: | ||
args: --verbose --no-progress "/github/workspace/test_output/**/*.html" | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
- name: Fail on HTML Link Check Errors | ||
run: exit ${{ steps.lychee_html.outputs.exit_code }} |
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,34 @@ | ||
name: Lint Python with flake8 | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
lint: | ||
name: Lint Python with flake8 | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install Ubuntu packages | ||
run: | | ||
sudo apt install -y python3-pip | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 | ||
- name: Lint with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# E203: Spaces around colons in array indexing collides with black-formatting | ||
# E402: Imports always on top collide with the need to set the python module search path in some places | ||
# W503: Collides with black formatting | ||
flake8 . --count --max-complexity=10 --max-line-length=200 --statistics --ignore=E203,E402,W503 |
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,29 @@ | ||
name: Local Package Build | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
local_package_build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install Ubuntu packages | ||
run: | | ||
sudo apt install -y python3-pip | ||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install build | ||
- name: Local Python Packaging | ||
run: | | ||
python3 -m 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: PyPI Package Deploy | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
package_deploy: | ||
if: startsWith(github.ref, 'refs/tags') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.9 | ||
- name: Install pypa/build | ||
run: | | ||
python -m pip install build --user | ||
- name: Build a binary wheel and a source tarball | ||
run: | | ||
python -m build --sdist --wheel --outdir dist/ | ||
#- name: Publish distribution 📦 to Test PyPI | ||
# uses: pypa/gh-action-pypi-publish@master | ||
# with: | ||
# password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
# repository_url: https://test.pypi.org/legacy/ | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
|
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Module Tests | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
module_tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install Ubuntu packages | ||
run: | | ||
sudo apt install -y python3-pip | ||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install pytest | ||
python3 -m pip install -r ./requirements.txt | ||
- name: Test | ||
run: | | ||
mkdir test_output | ||
cd test_output | ||
python3 ../tests/test.py | ||
python3 ../tests/test_cpp_symbols.py | ||
- name: Prepare Example Deploy | ||
run: | | ||
mkdir example_deploy | ||
cd example_deploy | ||
cp -a ../test_output/pair_report_multi_page . | ||
cp ../test_output/pair_report_output.html . | ||
cp ../src/elf_diff/html/example_page.html ./index.html | ||
- name: Deploy To Github Pages | ||
uses: JamesIves/[email protected] | ||
if: ${{ github.event_name == 'push' }} # Only run on push to master (which only happens if a PR is merged) | ||
with: | ||
branch: gh-pages # The branch the action should deploy to. | ||
folder: /home/runner/work/elf_diff/elf_diff/example_deploy # The folder the action should deploy. |
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,34 @@ | ||
name: Local Package Install and Test | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
local_package_install_and_test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install Ubuntu packages | ||
run: | | ||
sudo apt install -y python3-pip python3-venv | ||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
- name: Generate venv | ||
run: | | ||
repo_root=$PWD | ||
cd .. | ||
python3 -m venv env | ||
source ./env/bin/activate | ||
mkdir test | ||
cd test | ||
python3 -m pip install "${repo_root}" | ||
python3 ${repo_root}/tests/test.py -p |
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 |
---|---|---|
|
@@ -4,7 +4,5 @@ include README.md | |
include setup.py | ||
|
||
graft examples | ||
graft html | ||
graft images | ||
graft src | ||
graft tests | ||
graft tests |
Oops, something went wrong.