Skip to content

Commit

Permalink
Merge pull request #1 from adafruit/workflows
Browse files Browse the repository at this point in the history
Workflows
  • Loading branch information
jepler authored Apr 10, 2022
2 parents 9606d34 + 055bb19 commit fce90bf
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 4 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
#
# SPDX-License-Identifier: MIT

name: Build CI

on: [pull_request, push]

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Translate Repo Name For Build Tools filename_prefix
id: repo-name
run: |
echo ::set-output name=repo-name::$(
echo ${{ github.repository }} |
awk -F '\/' '{ print tolower($2) }' |
tr '_' '-'
)
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Versions
run: |
python3 --version
- name: Checkout Current Repo
uses: actions/checkout@v1
- name: Library version
run: git describe --dirty --always --tags
- name: install dependencies
run: |
pip install --upgrade setuptools wheel twine readme_renderer testresources pre-commit build
- name: Setup problem matchers
uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1
- name: Pre-commit hooks
run: |
pre-commit run --all-files
- name: Build Python package
run: |
python -mbuild
twine check dist/*
- uses: actions/upload-artifact@v3
with:
name: wheel
path: |
dist/*.whl
- uses: actions/upload-artifact@v3
with:
name: tar
path: |
dist/*.tar*
19 changes: 19 additions & 0 deletions .github/workflows/failure-help-text.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SPDX-FileCopyrightText: 2021 Scott Shawcroft for Adafruit Industries
#
# SPDX-License-Identifier: MIT

name: Failure help text

on:
workflow_run:
workflows: ["Build CI"]
types:
- completed

jobs:
post-help:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.event == 'pull_request' }}
steps:
- name: Post comment to help
uses: adafruit/circuitpython-action-library-ci-failed@v1
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
#
# SPDX-License-Identifier: MIT

name: Release Actions

on:
release:
types: [published]

jobs:
upload-pypi:
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: "3.x"
- uses: actions/checkout@v1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.pypi_username }}
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
python -mbuild
twine upload dist/*
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ _build
build
*.egg-info
fluxvis/__version__.py

# Built by `python3 -mbuild`
dist
2 changes: 1 addition & 1 deletion etc/update-img.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ c1541 -format example,ds d64 disk.d64
find fluxvis -name \*.py | while read l; do c1541 -attach disk.d64 -write "$l" "`echo ${l##*/} | tr A-Z a-z`"; done

~/src/fluxengine/fluxengine write commodore1541 --no-verify -d disk.scp -i disk.d64
PYTHONPATH=../greaseweazle/scripts/ python3 -mfluxvis disk.scp etc/disk.jpg --oversample 3 --resolution 640 --stride 2 --tracks 35 --diameter 108
python3 -mfluxvis disk.scp etc/disk.jpg --oversample 3 --resolution 640 --stride 2 --tracks 35 --diameter 108
4 changes: 1 addition & 3 deletions fluxvis/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@
@click.option(
"--resolution", default=960, help="Resolution of square output image (default: 960)"
)
@click.option(
"--linear/--polar", default=False, help="Use a linear instead of polar image"
)
@click.option("--linear/--polar", default=False, help="Image style (default: polar)")
@click.option(
"--oversample", default=2, help="Increase oversampling of polar transformation"
)
Expand Down

0 comments on commit fce90bf

Please sign in to comment.