date: improve parsing #16
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: Lint and Build | |
on: | |
pull_request: | |
branches: [ master ] | |
push: | |
release: | |
types: | |
- created | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: cachix/install-nix-action@v16 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- uses: cachix/cachix-action@v10 | |
with: | |
name: sumnerevans | |
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" | |
- name: Install dependencies | |
run: nix-shell --command "poetry install" | |
- name: pre-commit | |
run: | | |
nix-shell --command "poetry run pre-commit run -av trailing-whitespace" | |
nix-shell --command "poetry run pre-commit run -av end-of-file-fixer" | |
nix-shell --command "poetry run pre-commit run -av check-yaml" | |
nix-shell --command "poetry run pre-commit run -av check-added-large-files" | |
- name: poetry check | |
if: always() | |
run: nix-shell --command "poetry check" | |
- name: flake8 | |
if: always() | |
run: nix-shell --command "poetry run flake8" | |
- name: mypy tracktime | |
if: always() | |
run: nix-shell --command "poetry run mypy tracktime" | |
- name: black --check . | |
if: always() | |
run: nix-shell --command "poetry run black --check ." | |
- name: custom style check | |
if: always() | |
run: nix-shell --command "poetry run ./cicd/custom_style_check.py" | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: cachix/install-nix-action@v16 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- uses: cachix/cachix-action@v10 | |
with: | |
name: sumnerevans | |
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" | |
- name: Install dependencies | |
run: nix-shell --command "poetry install" | |
- name: pytest | |
run: nix-shell --command "poetry run pytest" | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: cachix/install-nix-action@v16 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- uses: cachix/cachix-action@v10 | |
with: | |
name: sumnerevans | |
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" | |
- name: Install dependencies | |
run: nix-shell --command "poetry install" | |
- name: poetry build | |
run: nix-shell --command "poetry build" | |
test_deploy: | |
name: Test Deploy to PyPi | |
runs-on: ubuntu-latest | |
needs: [lint, test, build] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Run image | |
uses: abatilo/actions-poetry@v2.1.2 | |
- name: Run build | |
run: | | |
poetry build | |
- name: Dry run publish | |
run: | | |
poetry config pypi-token.pypi ${{ secrets.PYPI_DEPLOY_TOKEN }} | |
poetry publish --dry-run | |
deploy: | |
name: Deploy to PyPi | |
runs-on: ubuntu-latest | |
needs: [test_deploy] | |
if: ${{ github.event_name == 'release' && github.event.action == 'created' }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Run image | |
uses: abatilo/actions-poetry@v2.1.2 | |
- name: Run build | |
run: | | |
poetry build | |
- name: Actual publish | |
run: | | |
poetry config pypi-token.pypi ${{ secrets.PYPI_DEPLOY_TOKEN }} | |
poetry publish |