aboutsummaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/wee-slack.yml103
1 files changed, 103 insertions, 0 deletions
diff --git a/.github/workflows/wee-slack.yml b/.github/workflows/wee-slack.yml
new file mode 100644
index 0000000..f4db256
--- /dev/null
+++ b/.github/workflows/wee-slack.yml
@@ -0,0 +1,103 @@
+name: wee-slack
+on: [push, pull_request]
+
+jobs:
+ lint:
+ if: >
+ github.event_name == 'push' || (
+ github.event_name == 'pull_request' &&
+ github.event.pull_request.head.repo.full_name != github.repository
+ )
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python_version: [2.7, 3.7]
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Set up Python (${{ matrix.python_version }})
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python_version }}
+
+ - uses: actions/cache@v2
+ env:
+ cache-name: lint-pip
+ with:
+ path: ${{ env.pythonLocation }}
+ key: ${{ runner.os }}-${{ matrix.python_version }}-${{ env.cache-name }}-${{ github.sha }}
+ restore-keys: |
+ ${{ runner.os }}-${{ matrix.python_version }}-${{ env.cache-name }}-
+
+ - name: Install Pipenv
+ run: |
+ pip install --upgrade pipenv
+
+ - uses: actions/cache@v2
+ env:
+ cache-name: lint-pipenv
+ with:
+ path: "$GITHUB_WORKSPACE/.venv"
+ key: ${{ runner.os }}-${{ matrix.python_version }}-${{ env.cache-name }}-${{ github.sha }}
+ restore-keys: |
+ ${{ runner.os }}-${{ matrix.python_version }}-${{ env.cache-name }}-
+
+ - name: Install dependencies
+ run: |
+ pipenv install --dev --skip-lock
+
+ - name: Lint with Flake8
+ run: |
+ # stop the build if there are Python syntax errors or undefined names
+ pipenv run flake8 .
+
+ # exit-zero treats all errors as warnings.
+ pipenv run flake8 . --exit-zero --select=C,E,F,W
+
+ test:
+ if: >
+ github.event_name == 'push' || (
+ github.event_name == 'pull_request' &&
+ github.event.pull_request.head.repo.full_name != github.repository
+ )
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python_version: [2.7, 3.7]
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Set up Python (${{ matrix.python_version }})
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python_version }}
+
+ - uses: actions/cache@v2
+ env:
+ cache-name: test-pip
+ with:
+ path: ${{ env.pythonLocation }}
+ key: ${{ runner.os }}-${{ matrix.python_version }}-${{ env.cache-name }}-${{ github.sha }}
+ restore-keys: |
+ ${{ runner.os }}-${{ matrix.python_version }}-${{ env.cache-name }}-
+
+ - name: Install Pipenv
+ run: |
+ pip install --upgrade pipenv
+
+ - uses: actions/cache@v2
+ env:
+ cache-name: test-pipenv
+ with:
+ path: "$GITHUB_WORKSPACE/.venv"
+ key: ${{ runner.os }}-${{ matrix.python_version }}-${{ env.cache-name }}-${{ github.sha }}
+ restore-keys: |
+ ${{ runner.os }}-${{ matrix.python_version }}-${{ env.cache-name }}-
+
+ - name: Install dependencies
+ run: |
+ pipenv install --dev --skip-lock
+
+ - name: python/test
+ run: |
+ pipenv run pytest