-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.51 KB
/
linter.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
on:
# For all pushes run the tests
push:
# Also trigger on pull_request
pull_request:
# Run nightly tests at 04:00 UTC
schedule:
- cron: "0 4 * * *"
# Manually triggered
workflow_dispatch:
name: Lint
jobs:
docker:
runs-on: ubuntu-latest
container:
image: python:latest
env:
GITHUB_PAT: ${{ secrets.INSTALL_GITHUB }}
# If the PR is coming from a fork (pull_request_target), ensure it is opened
# by "dependabot[bot]". Otherwise, clone it normally.
CC_API_ORGANISATION: ${{ secrets.CC_API_ORGANISATION }}
CC_API_KEY: ${{ secrets.CC_API_KEY }}
if: |
(github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]') ||
(github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]')
steps:
- name: Checkout
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v4
- name: Checkout PR
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup virtualenv
run: |
python -V # Print out python version for debugging
pip install virtualenv pytest
virtualenv venv
. venv/bin/activate
- name: Install dependencies
run: pip install coverage pytest pandas flake8 setuptools .
- name: Install package
run: python setup.py develop
- name: Run Flake8
run: flake8