diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index fb0d976..098bcc7 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -1,4 +1,4 @@ -name: CTest +name: Test and Lint on: push: @@ -7,7 +7,7 @@ on: branches: ["main", "dev"] jobs: - build-and-test: + build: runs-on: ubuntu-latest steps: @@ -23,5 +23,43 @@ jobs: - name: Build run: cmake --build build - - name: Run tests - run: ctest --test-dir build --output-on-failure \ No newline at end of file + - uses: actions/upload-artifact@v4 + with: + name: built + path: ./build + + + test: + needs: build + runs-on: ubuntu-latest + + steps: + - uses: actions/download-artifact@v4 + with: + name: built + path: ./build + + - name: Make test binary executable + run: chmod +x build/bin/RandomizerTests + + - name: run-tests + run: ctest --test-dir build --output-on-failure + + lint: + needs: build + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - uses: actions/download-artifact@v4 + with: + name: built + path: ./build + + - name: Get clang-tidy + run: sudo apt-get update && sudo apt-get install -y cmake clang clang-tidy g++ + + - name: lint + run: ./run-clang-tidy.py -p build -source-filter '^(?!.*_deps/googletest-src/).*'