Update format check. #59
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Regression Test | |
on: | |
push: | |
branches: | |
- dev | |
- master | |
- demos | |
- final | |
jobs: | |
code-format-check: | |
name: Code Format Check | |
runs-on: ubuntu-latest | |
env: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
container: | |
image: columbiasld/esp:ubuntu18-small | |
credentials: | |
username: ${{ env.DOCKER_USERNAME }} | |
password: ${{ env.DOCKER_PASSWORD }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Install vsg | |
run: | | |
pip3 install vsg | |
echo 'export PATH="$PATH:/home/espuser/.local/bin/"' >> ~/.bashrc | |
- name: Install clang-format-10 | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y clang-format-10 | |
- name: Install autopep8 | |
run: | | |
pip3 install autopep8 | |
- name: Install Verible | |
run: | | |
wget https://github.com/chipsalliance/verible/releases/download/v0.0-3545-ge4028f19/verible-v0.0-3545-ge4028f19-linux-static-x86_64.tar.gz | |
tar -xvf verible-v0.0-3545-ge4028f19-linux-static-x86_64.tar.gz | |
rm verible-v0.0-3545-ge4028f19-linux-static-x86_64.tar.gz | |
mv verible-v0.0-3545-ge4028f19/ verible | |
export PATH=$PATH:/home/espuser/verible/bin | |
echo 'export PATH="$PATH:/home/espuser/verible/bin"' >> ~/.bashrc | |
- name: Source .bashrc | |
run: | | |
. ~/.bashrc | |
- name: Run code formatting check | |
run: | | |
pwd | |
cd /utils/scripts/actions-pipeline/code-format/ | |
pwd | |
chmod +x format_modified.sh | |
if [ -n "$(git rev-parse --show-toplevel 2>/dev/null)" ]; then | |
if ! ./format_modified.sh -g -ca; then | |
echo "Code format check failed. Please fix the formatting issues by running the following script: /utils/scripts/format_modified.sh" | |
exit 1 | |
fi | |
else | |
echo "Not in a Git repository. Skipping code formatting check." | |
fi | |