Skip to content

Commit

Permalink
Add github actions for syntax testing
Browse files Browse the repository at this point in the history
  • Loading branch information
henrykironde committed Feb 22, 2023
1 parent 4ed9be8 commit f8c54de
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: YAPF Google chromium style

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
ci:
name: "CI setup"

strategy:
fail-fast: false
matrix:
python-version:
- 3.9
os:
- "ubuntu-latest"

runs-on: "${{ matrix.os }}"

# use bash everywhere
defaults:
run:
shell: "bash -l {0}"

steps:
- uses: actions/checkout@v3
- uses: mamba-org/provision-with-micromamba@v15
with:
environment-name: Zooniverse
environment-file: Zooniverse/dev_environment.yml
python-version: "${{ matrix.python-version }}"
cache-env: true
cache-downloads: true

- name: "Run tests"
run: |
yapf -d --recursive ./Zooniverse/ --style=.style.yapf 2>&1
4 changes: 4 additions & 0 deletions .style.yapf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[style]
# YAPF uses the chromium style
based_on_style = google
COLUMN_LIMIT=120
9 changes: 9 additions & 0 deletions dev_environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Zooniverse
channels: [conda-forge]
dependencies:
- python
- yapf
- black
- pytest-cov
- pytest-xdist
- pdoc

0 comments on commit f8c54de

Please sign in to comment.