diff --git a/.github/workflows/linters.yaml b/.github/workflows/linters.yaml new file mode 100644 index 00000000..b7dc446d --- /dev/null +++ b/.github/workflows/linters.yaml @@ -0,0 +1,32 @@ +name: Linters + +on: + push: + branches: + - develop + pull_request: + branches: + - develop + +jobs: + cpp-linters: + name: "C++ linters" + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Run C++ linters + uses: cpp-linter/cpp-linter-action@v2 + id: linter + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + extensions: 'cpp,hpp' + style: 'file' # use .clang-format config file + tidy-checks: '-*' # disable clang-tidy checks + version: 18 + - name: Fail fast + if: steps.linter.outputs.clang-format-checks-failed > 0 + run: | + echo "::notice::Try executing 'python3 ./scripts/run_cpp_linters.py .' to fix linter issues." + exit 1 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4acd1a2c..6fdff61e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -8,33 +8,8 @@ on: pull_request: jobs: - cpp-linters: - name: "C++ linters" - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Run C++ linters - uses: cpp-linter/cpp-linter-action@v2 - id: linter - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - extensions: 'cpp,hpp' - files-changed-only: 'false' - format-review: 'true' - style: 'file' # use .clang-format config file - tidy-checks: '-*' # disable clang-tidy checks - version: 18 - - name: Fail fast - if: steps.linter.outputs.clang-format-checks-failed > 0 - run: | - echo "::notice::Try executing 'python3 ./scripts/run_cpp_linters.py .' to fix linter issues." - exit 1 - cpp-linux-x64: name: "C++ tests (gcc-clang/Linux/x64)" - needs: cpp-linters runs-on: ubuntu-latest strategy: fail-fast: false @@ -56,10 +31,10 @@ jobs: cpp-linux-arm64: name: "C++ tests (gcc/Linux/ARM64)" - needs: cpp-linters runs-on: [self-hosted, ARM64, Linux] container: python:3.11 - # Run only when merging to develop (until we have a GitHub-hosted runner for Linux/ARM64) + # Run only when merging to develop + # (until we have a GitHub-hosted runner for Linux/ARM64) if: github.ref == 'refs/heads/develop' strategy: fail-fast: false @@ -89,7 +64,6 @@ jobs: cpp-macos-x64: name: "C++ tests (clang/MacOS/x64)" - needs: cpp-linters runs-on: macos-13 # x64 strategy: fail-fast: false @@ -108,7 +82,6 @@ jobs: cpp-macos-arm64: name: "C++ tests (clang/macos/ARM64)" - needs: cpp-linters runs-on: macos-14 # arm64 strategy: fail-fast: false @@ -127,7 +100,6 @@ jobs: cpp-windows-x64: name: "C++ tests (msvc/Windows/x64)" - needs: cpp-linters runs-on: windows-latest strategy: fail-fast: false @@ -147,7 +119,6 @@ jobs: cpp-shared: name: "C++ tests (shared)" - needs: cpp-linters runs-on: ubuntu-latest strategy: fail-fast: false @@ -166,7 +137,6 @@ jobs: ts-emscripten-wasm: name: "TS tests (clang/emscripten/wasm)" - needs: cpp-linters runs-on: ubuntu-latest strategy: fail-fast: false @@ -212,7 +182,6 @@ jobs: python-linux-x64: name: "Python tests (Linux/x64)" - needs: cpp-linters runs-on: ubuntu-latest steps: - name: Checkout @@ -231,7 +200,6 @@ jobs: python-macos-x64: name: "Python tests (macOS/x64)" - needs: cpp-linters runs-on: macos-13 steps: - name: Checkout @@ -250,7 +218,6 @@ jobs: python-macos-arm64: name: "Python tests (macOS/arm64)" - needs: cpp-linters runs-on: macos-14 steps: - name: Checkout @@ -269,7 +236,6 @@ jobs: python-windows-x64: name: "Python tests (Windows/x64)" - needs: cpp-linters runs-on: windows-latest steps: - name: Checkout @@ -284,7 +250,6 @@ jobs: docker: name: Docker - needs: cpp-linters runs-on: ubuntu-latest steps: - name: Set up QEMU