Skip to content

ci: add check formatting workflow #89

ci: add check formatting workflow

ci: add check formatting workflow #89

Workflow file for this run

name: "CI for Pull Requests"
on:
pull_request:
branches: [ 'main' ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check-licenses:
name: License checks for SIL Kit sources
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: false
- name: Install Dependencies
id: dep-install
run: |
sudo apt install licensecheck
- name: Check Licenses
id: license-check
run: |
sh ./SilKit/ci/check_licenses.sh
shell: bash
check-files-changed:
runs-on: ubuntu-22.04
outputs:
run_builds: ${{ steps.files_check.outputs.run_builds }}
steps:
- uses: actions/checkout@v4
with:
submodules: false
- name: Check changed files
id: files_check
run: |
python3 ./SilKit/ci/check_files_changed.py ${{ github.repository }} ${{ github.event.number }}
check-formatting:
name: Format checks for SIL Kit sources
runs-on: ubuntu-22.04
steps:
- name: Install clang-format 18
id: install-clang18
run: |
wget https://apt.llvm.org/llvm.sh /tmp/llvm.sh
chmod +x /tmp/llvm.sh
sh sudo /tmp/llvm.sh 18
sudo apt install clang-format-18
- uses: actions/checkout@v4
with:
submodules: false
- name: Check Formatting
id: formatting-check
run: |
python3 ./SilKit/ci/check_formatting.py
shell: bash
- name: Upload Log
if: always()
id: format-result-upload
uses: actions/upload-artifact@v4
with:
name: FormatLog
path: FormatLog.txt
if-no-files-found: 'ignore'
compression-level: 5
clang14-tsan:
name: Thread Sanitizer Tests
needs: [check-licenses, check-files-changed, check-formatting]
uses: ./.github/workflows/linux-tsan.yml
with:
run_build: ${{ needs.check-files-changed.outputs.run_builds == 'true' }}
clang14-ubsan:
name: Undefined Behavior Sanitizer Tests
needs: [check-licenses, check-files-changed, check-formatting]
uses: ./.github/workflows/linux-ubsan.yml
with:
run_build: ${{ needs.check-files-changed.outputs.run_builds == 'true' }}
clang14-asan:
name: Address Sanitizer Tests
needs: [check-licenses, check-files-changed, check-formatting]
uses: ./.github/workflows/linux-asan.yml
with:
run_build: ${{ needs.check-files-changed.outputs.run_builds == 'true' }}
ubuntu-release-builds:
uses: ./.github/workflows/build-linux.yml
needs: [check-licenses, check-files-changed, check-formatting]
with:
do_package: ${{ github.event_name == 'push' && true || false }}
retention_days: ${{ github.event_name == 'push' && 90 || 14 }}
run_build: ${{ needs.check-files-changed.outputs.run_builds == 'true' }}
windows-release-builds:
uses: ./.github/workflows/build-win.yml
needs: [check-licenses, check-files-changed, check-formatting]
with:
do_package: ${{ github.event_name == 'push' && true || false }}
retention_days: ${{ github.event_name == 'push' && 90 || 14 }}
run_build: ${{ needs.check-files-changed.outputs.run_builds == 'true' }}