2022-10-06 21:21:25 -05:00
|
|
|
name: Code Format
|
|
|
|
|
|
|
|
# Run CI on push, PR, and weekly.
|
|
|
|
|
|
|
|
on:
|
2024-06-11 15:53:33 -05:00
|
|
|
workflow_dispatch:
|
2022-10-06 21:21:25 -05:00
|
|
|
pull_request:
|
2024-06-11 15:53:33 -05:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
2022-10-06 21:21:25 -05:00
|
|
|
schedule:
|
|
|
|
- cron: "0 0 * * 0 " # weekly
|
|
|
|
|
2024-06-10 14:19:58 -05:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-10-06 21:21:25 -05:00
|
|
|
# Multiple job to tests
|
|
|
|
jobs:
|
|
|
|
change_detect:
|
|
|
|
name: "Check"
|
2024-05-05 18:15:45 -05:00
|
|
|
runs-on: ubuntu-22.04
|
2022-10-06 21:21:25 -05:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
config:
|
|
|
|
- name: "C/C++"
|
|
|
|
code_type: "-cpp"
|
2024-05-05 18:15:45 -05:00
|
|
|
dependency_version: "ubuntu22p04"
|
2022-10-07 12:21:14 -05:00
|
|
|
- name: "XML"
|
|
|
|
code_type: "-xml"
|
2024-05-05 18:15:45 -05:00
|
|
|
dependency_version: "ubuntu22p04"
|
2022-11-21 16:21:14 -06:00
|
|
|
- name: "Python"
|
|
|
|
code_type: "-py"
|
2024-05-05 18:15:45 -05:00
|
|
|
dependency_version: "ubuntu22p04"
|
2022-10-06 21:21:25 -05:00
|
|
|
steps:
|
|
|
|
- name: Cancel previous
|
2024-06-24 17:17:57 -05:00
|
|
|
uses: styfle/cancel-workflow-action@0.12.1
|
2022-10-06 21:21:25 -05:00
|
|
|
with:
|
|
|
|
access_token: ${{ github.token }}
|
|
|
|
|
2022-10-06 22:49:38 -05:00
|
|
|
- name: Checkout OpenFPGA repo
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2022-10-06 21:21:25 -05:00
|
|
|
- name: Install dependencies
|
2022-11-21 16:21:14 -06:00
|
|
|
run: |
|
2024-05-05 18:15:45 -05:00
|
|
|
sudo bash ./.github/workflows/install_dependencies_build_${{ matrix.config.dependency_version }}.sh
|
2022-11-21 16:21:14 -06:00
|
|
|
sudo python3 -m pip install -r requirements.txt
|
2022-10-06 21:21:25 -05:00
|
|
|
|
|
|
|
- name: Dump tool versions
|
|
|
|
run: |
|
2024-05-05 18:15:45 -05:00
|
|
|
clang-format-14 --version
|
2022-11-21 16:21:14 -06:00
|
|
|
black --version
|
2022-10-06 21:21:25 -05:00
|
|
|
|
|
|
|
- name: Check format
|
|
|
|
run: ./dev/check-format.sh ${{ matrix.config.code_type }}
|