HPI/.github/workflows/main.yml
Sean Breckenridge 8422c6e420
my.reddit: refactor into module that supports pushshift/gdpr (#179)
* initial pushshift/rexport merge implementation, using id for merging
* smarter module deprecation warning using regex
* add `RedditBase` from promnesia
* `import_source` helper for gracefully handing mixin data sources
2021-10-31 20:39:04 +00:00

85 lines
2.7 KiB
YAML

# see https://github.com/karlicoss/pymplate for up-to-date reference
name: CI
on:
push:
branches: '*'
tags: 'v[0-9]+.*' # only trigger on 'release' tags for PyPi
# Note that people who fork it need to go to "Actions" tab on their fork and click "I understand my workflows, go ahead and enable them".
pull_request: # needed to trigger on others' PRs
workflow_dispatch: # needed to trigger workflows manually
# todo cron?
env:
# useful for scripts & sometimes tests to know
CI: true
jobs:
build:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest] # TODO windows-latest??
python-version: [3.6, 3.7, 3.8]
# seems like 3.6 isn't available on their osx image anymore
exclude: [{platform: macos-latest, python-version: 3.6}]
runs-on: ${{ matrix.platform }}
steps:
# ugh https://github.com/actions/toolkit/blob/main/docs/commands.md#path-manipulation
- run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0 # nicer to have all git history when debugging/for tests
# uncomment for SSH debugging
# - uses: mxschmitt/action-tmate@v3
- run: scripts/ci/run
- uses: actions/upload-artifact@v2
with:
name: .coverage.mypy-misc_${{ matrix.platform }}_${{ matrix.python-version }}
path: .coverage.mypy-misc/
- uses: actions/upload-artifact@v2
with:
name: .coverage.mypy-core_${{ matrix.platform }}_${{ matrix.python-version }}
path: .coverage.mypy-core/
pypi:
runs-on: ubuntu-latest
needs: [build] # add all other jobs here
steps:
# ugh https://github.com/actions/toolkit/blob/main/docs/commands.md#path-manipulation
- run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- uses: actions/setup-python@v2
with:
python-version: '3.7'
- uses: actions/checkout@v2
with:
submodules: recursive
- name: 'release to test pypi'
# always deploy merged master to test pypi
if: github.event_name != 'pull_request' && github.event.ref == 'refs/heads/master'
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD_TEST }}
run: pip3 install --user wheel twine && scripts/release --test
# TODO run pip install just to test?
- name: 'release to pypi'
# always deploy tags to release pypi
# NOTE: release tags are guarded by on: push: tags on the top
if: github.event_name != 'pull_request' && startsWith(github.event.ref, 'refs/tags')
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: pip3 install --user wheel twine && scripts/release