| name: Lint | |
| on: | |
| push: | |
| pull_request: | |
| merge_group: | |
| concurrency: | |
| # Skip intermediate builds: always. | |
| # Cancel intermediate builds: only if it is a pull request build. | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | |
| jobs: | |
| emission-order: | |
| name: Deterministic IR emission order | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Enzyme repository | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Check for order-dependent IR emission | |
| run: | | |
| python3 enzyme/scripts/check_emission_order.py --github \ | |
| --include-llvm-builder enzyme/Enzyme | |
| llvm-api: | |
| name: Direct use of wrapped LLVM APIs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Enzyme repository | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Check for direct LLVM API calls that Utils.h wraps | |
| run: | | |
| python3 enzyme/scripts/check_llvm_api.py --github enzyme/Enzyme | |
| fortran-lint: | |
| name: Linting for Fortran source | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Enzyme repository | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Install Fortitude | |
| run: | | |
| python3 -m venv enzyme_venv | |
| . enzyme_venv/bin/activate | |
| pip install fortitude-lint | |
| - name: Run Fortitude check | |
| run: | | |
| . enzyme_venv/bin/activate | |
| fortitude check | |
| shell-lint: | |
| name: Linting for shell scripts | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Enzyme repository | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Install Shellcheck | |
| run: | | |
| sudo apt update | |
| sudo apt install shellcheck | |
| - name: Run Shellcheck | |
| run: shellcheck -x $(find enzyme -name '*.sh') | |
| cmake-lint: | |
| name: Linting for CMakeLists.txt files | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Enzyme repository | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Install cmakefmt | |
| run: | | |
| python3 -m venv enzyme_venv | |
| . enzyme_venv/bin/activate | |
| pip install cmakefmt | |
| - name: Run cmakefmt --check | |
| run: | | |
| . enzyme_venv/bin/activate | |
| cmakefmt --check | |
| zizmor: | |
| name: GitHub Actions linting | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| permissions: | |
| security-events: write # We trust the zizmor action with write permissions | |
| steps: | |
| - name: Checkout Enzyme repository | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Run zizmor | |
| uses: zizmorcore/zizmor-action@e673c3917a1aef3c65c972347ed84ccd013ecda4 # v0.2.0 |