Add CI checks for file formatting and style checks

This commit is contained in:
Aaron Franke
2021-01-26 21:35:19 -05:00
parent d9c80738d0
commit ffe5d94d6e
9 changed files with 533 additions and 0 deletions

30
.github/workflows/static_checks.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: 📊 Static Checks
on: [push, pull_request]
jobs:
static-checks:
name: Static Checks (black format, file format)
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
# Azure repositories are not reliable, we need to prevent Azure giving us packages.
- name: Make apt sources.list use the default Ubuntu repositories
run: |
sudo rm -f /etc/apt/sources.list.d/*
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
sudo apt-get update
- name: Install dependencies
run: |
sudo apt-get install -qq dos2unix recode
sudo pip3 install black==20.8b1
- name: File formatting checks (file_format.sh)
run: |
bash ./misc/scripts/file_format.sh
- name: Python style checks via black (black_format.sh)
run: |
bash ./misc/scripts/black_format.sh