Stop excluding NEWLINE token when checking token list (#88) #358
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
name: build | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [opened, synchronize] | |
branches: | |
- master | |
release: | |
types: [published] | |
jobs: | |
publish: | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
needs: [test, lint] | |
if: github.event_name == 'release' | |
env: | |
python_version_publish: "3.12" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache | |
key: ${{ runner.os }}-python${{ env.python_version_publish }}-pipcache | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.python_version_publish }} | |
- name: Install denendencies | |
run: | | |
set -eux | |
if ! twine --version | |
then | |
make publish-installdeps | |
fi | |
twine --version | |
- name: Assert version | |
run: | | |
set -eux | |
test refs/tags/v`python3 ./setup.py --version` == "${{ github.ref }}" | |
- name: Publish to pypi | |
run: make publish publish_repository=pypi | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
test: | |
timeout-minutes: 5 | |
strategy: | |
matrix: | |
# Available versions: | |
# https://github.com/actions/python-versions/blob/main/versions-manifest.json | |
python-version: ["3.10", "3.11", "3.12", "pypy-3.7"] | |
runs-on: [ubuntu-latest] | |
include: | |
- python-version: "3.9" | |
runs-on: ubuntu-20.04 | |
- python-version: "3.8" | |
runs-on: ubuntu-20.04 | |
- python-version: "3.7" | |
runs-on: ubuntu-20.04 | |
- python-version: "3.6" | |
runs-on: ubuntu-20.04 | |
env: | |
python_version_codecov: "3.12" | |
runs-on: ${{ matrix.runs-on }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache packages | |
# https://github.com/actions/cache/issues/152 | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache | |
key: ${{ runner.os }}-python${{ matrix.python-version }}-pipcache | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install denendencies | |
run: | | |
set -eux | |
pip install . coverage codecov | |
- name: Run test | |
run: | | |
set -eux | |
python --version | |
flake8 --version | |
make test | |
- name: Run codecov | |
uses: codecov/codecov-action@v4 | |
if: matrix.python-version == env.python_version_codecov | |
lint: | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
env: | |
python_version_lint: "3.12" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache | |
key: ${{ runner.os }}-python${{ env.python_version_lint }}-pipcache | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.python_version_lint }} | |
- name: Install denendencies | |
run: | | |
set -eux | |
pip install .[dev] | |
- name: Run linter | |
run: make lint |