[GitHub Actions] weekly overnight tests #21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run Tests on Implementation in C | |
| on: | |
| push: | |
| branches: main | |
| paths: ["C-method/**", "tests/**", ".github/workflows/**"] | |
| pull_request: | |
| branches: main | |
| paths: ["C-method/**", "tests/**", ".github/workflows/**"] | |
| schedule: | |
| # Overnight: run tests every Thursday at 20:00 UTC | |
| # cron <minute> <hour> <day-of-month> <day-of-week (sunday=0)> | |
| - cron: "0 20 * * 4" | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Install dependencies (G++, Valgrind, Python3, cpplint) | |
| run: | | |
| sudo apt update | |
| sudo apt install -y build-essential valgrind python3 | |
| pip3 install --user cpplint | |
| - name: Setup | |
| working-directory: ./C-method | |
| run: | | |
| chmod +x setup.sh | |
| sudo ./setup.sh | |
| - name: Compile | |
| working-directory: ./C-method | |
| run: make 2>&1 | tee compile_info.txt | |
| - name: Run tests (implementation & coding style) | |
| working-directory: ./C-method | |
| run: python3 checker.py 2>&1 | tee test_results.txt | |
| - name: Upload test logs as artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: checker-logs | |
| path: | | |
| ./C-method/compile_info.txt | |
| ./C-method/test_results.txt | |
| # Without `*` globbing, folders files will not be uploaded | |
| tests/output-C-method/* | |
| retention-days: 7 |