forked from enermaps/enermaps
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (67 loc) · 2.81 KB
/
pr_to_master.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# This is a basic workflow to help you get started with Actions
name: PR precheck
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
pull_request:
branches:
- '**' # matches every branch
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
lint:
# The type of runner that the job will run on
runs-on: 'ubuntu-18.04'
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
- run: |
# Hack to get setup-python to work on act
if [ ! -f "/etc/lsb-release" ] ; then
echo "DISTRIB_RELEASE=18.04" > /etc/lsb-release
fi
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: install linters
run: pip install -r linter-requirements.txt
- name: check-lint with isort
run: cd api && isort --profile black --check --diff .
- name: check-lint with black
run: cd api && black --diff --check --experimental-string-processing .
- name: check-lint with bandit
run: cd api && bandit -r .
- name: check-lint with flake8
run: cd api && flake8 **/*py
- name: check-lint cms
run: cd cm && ./.check_cm.sh
- name: install dependencies for the frontend
run: cd frontend/src && npm install .
- name: check-lint the frontend
run: cd frontend/src && npx eslint .
- name: ensure all setup.cfg are the same
run: find . -name setup.cfg -exec sha256sum {} \; | cut -d ' ' -f 1 | uniq -u | test -z
verify-licenses:
# The type of runner that the job will run on
runs-on: 'ubuntu-18.04'
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: install liccheck
run: find . -name requirements.txt -print -exec pip install -r {} \; -exec liccheck -s .liccheck.ini -r {} \;
- name: verify python licenses
run: find . -name setup.cfg -exec sha256sum {} \; | cut -d ' ' -f 1 | uniq -u | test -z
- name: verify npm license
run: npx license-checker --onlyAllow MIT\;BSD-3-Clause\;ISC\;Apache-2.0\;BSD-2-Clause\;Public\ Domain\;AFLV2,BSD\;AFLv2.1\;WTFPL\;Custom:\ https://rollupjs.org\;Unlicense\;
build-stack:
runs-on: 'ubuntu-18.04'
steps:
- uses: actions/checkout@v2
- name: Create an empty file for CDS API that should be kept only locally
run: touch data-integration/.cdsapirc
- name: Run docker-compose stack
run: docker-compose build --parallel