Golf (#207) #2609
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: programming team code CI | |
| on: push | |
| permissions: | |
| contents: write | |
| jobs: | |
| library_checker_aizu: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v1 | |
| - name: Set up Python | |
| uses: actions/setup-python@v1 | |
| - name: Install dependencies | |
| run: | | |
| pip install "setuptools<81" | |
| pip install -U online-judge-verify-helper | |
| - name: Set up Rust (nightly) | |
| run: | | |
| rustup set profile minimal | |
| rustup install nightly | |
| rustup override set nightly | |
| - name: Set up git submodules | |
| run: | | |
| git submodule init | |
| git submodule update | |
| rm -rf hackpack-cpp/tests/ | |
| - name: Run library checker and aizu tests | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: oj-verify all --tle 60 --timeout 21600 | |
| grep_clangformat_cppcheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install LLVM | |
| run: | | |
| wget https://apt.llvm.org/llvm.sh | |
| chmod +x llvm.sh | |
| sudo ./llvm.sh 22 | |
| - name: Install dependencies | |
| run: sudo apt install -y clang-format-22 cppcheck | |
| - name: Verify | |
| run: | | |
| clang-22 --version | |
| clang-format-22 --version | |
| - name: grep, clang-format, cppcheck | |
| run: make --directory=tests/ grep_clangformat_cppcheck | |
| clangtidy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install LLVM | |
| run: | | |
| wget https://apt.llvm.org/llvm.sh | |
| chmod +x llvm.sh | |
| sudo ./llvm.sh 22 | |
| - name: Install dependencies | |
| run: sudo apt install -y clang-tidy-22 | |
| - name: Verify | |
| run: | | |
| clang-22 --version | |
| clang-tidy-22 --version | |
| - name: clang-tidy | |
| run: make --directory=tests/ clangtidy | |
| compile_gcc: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: g++ with gcc | |
| run: make --directory=tests/ compile_gcc | |
| compile_clang: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install LLVM | |
| run: | | |
| wget https://apt.llvm.org/llvm.sh | |
| chmod +x llvm.sh | |
| sudo ./llvm.sh 22 | |
| - name: Verify | |
| run: | | |
| clang-22 --version | |
| - name: g++ with clang | |
| run: make --directory=tests/ compile_clang | |
| find_files_without_tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: find files without tests | |
| run: make --directory=tests/ find_files_without_tests | |
| build_pdf: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install texlive, rename, nodejs, npm | |
| run: | | |
| sudo apt install texlive texlive-latex-extra rename nodejs npm | |
| - name: Install LLVM | |
| run: | | |
| wget https://apt.llvm.org/llvm.sh | |
| chmod +x llvm.sh | |
| sudo ./llvm.sh 22 | |
| - name: Verify | |
| run: | | |
| clang-22 --version | |
| - name: build pdf | |
| run: make --directory=tests/ build_pdf | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ptc | |
| path: tests/ptc.pdf | |
| publish_pdf: | |
| runs-on: ubuntu-latest | |
| needs: [library_checker_aizu, grep_clangformat_cppcheck, clangtidy, compile_gcc, compile_clang, find_files_without_tests, build_pdf] | |
| if: github.ref == 'refs/heads/dev' && github.event_name == 'push' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: ptc | |
| path: tests/ptc.pdf | |
| - uses: marvinpinto/action-automatic-releases@latest | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| automatic_release_tag: ptc | |
| prerelease: false | |
| title: ptc | |
| files: tests/ptc.pdf | |
| update_main: | |
| runs-on: ubuntu-latest | |
| needs: [library_checker_aizu, grep_clangformat_cppcheck, clangtidy, compile_gcc, compile_clang, find_files_without_tests, build_pdf] | |
| if: github.ref == 'refs/heads/dev' && github.event_name == 'push' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install LLVM | |
| run: | | |
| wget https://apt.llvm.org/llvm.sh | |
| chmod +x llvm.sh | |
| sudo ./llvm.sh 22 | |
| - name: Install dependencies | |
| run: sudo apt install -y clang-format-22 cppcheck | |
| - name: Verify | |
| run: | | |
| clang-22 --version | |
| clang-format-22 --version | |
| - name: Combine includes and force push to main branch | |
| run: | | |
| git config --local user.name github-actions | |
| git config --local user.email 160645609+programming-team-code@users.noreply.github.com | |
| make --directory=tests/ update_main | |
| git rm -rf library/ tests/ .verify-helper/ .gitmodules kactl/ hackpack-cpp/ notebook-generator/ .github/ | |
| git add --all | |
| git commit --message "programming_team_code" | |
| git checkout -b main | |
| git push origin main --force | |
| shellcheck_shfmt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: sudo apt install shfmt shellcheck | |
| - name: shellcheck, shfmt | |
| run: make --directory=tests/ shellcheck_shfmt |