Simplify (#107) #1659
This file contains 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, workflow_dispatch] | |
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: pip3 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 tests | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: oj-verify all --tle 35 --timeout 21600 | |
check_format_lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up LLVM repository | |
run: | | |
sudo apt update | |
sudo apt install -y wget software-properties-common | |
wget -O - https://apt.llvm.org/llvm.sh | sudo bash | |
- name: Install dependencies | |
run: sudo apt update && sudo apt install -y clang-format-18 cppcheck | |
- name: checks format then lints | |
run: make --directory=tests/ check_format_lint | |
clangtidy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up LLVM repository | |
run: | | |
sudo apt update | |
sudo apt install -y wget software-properties-common | |
wget -O - https://apt.llvm.org/llvm.sh | sudo bash | |
- name: Install dependencies | |
run: sudo apt update && sudo apt install -y clang-tidy-18 | |
- name: clang-tidy | |
run: make --directory=tests/ clangtidy | |
compile_gcc: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Compile all tests | |
run: make --directory=tests/ compile_gcc | |
compile_clang: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: wget -qO- https://apt.llvm.org/llvm.sh | sudo bash -s -- 18 | |
- name: Compile all tests | |
run: make --directory=tests/ compile_clang | |
files_without_tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: files without tests | |
run: make --directory=tests/ files_without_tests | |
build_ptc: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install texlive, rename, nodejs, npm, clang | |
run: | | |
sudo apt update | |
sudo apt install texlive texlive-latex-extra rename nodejs npm | |
wget -qO- https://apt.llvm.org/llvm.sh | sudo bash -s -- 18 | |
- name: build ptc | |
run: make --directory=tests/ ptc | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ptc | |
path: tests/ptc.pdf | |
publish_ptc: | |
runs-on: ubuntu-latest | |
needs: [library_checker_aizu, check_format_lint, clangtidy, compile_gcc, compile_clang, files_without_tests, build_ptc] | |
if: github.ref == 'refs/heads/dev' && github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/download-artifact@v3 | |
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, check_format_lint, clangtidy, compile_gcc, compile_clang, files_without_tests] | |
if: github.ref == 'refs/heads/dev' && github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up LLVM repository | |
run: | | |
sudo apt update | |
sudo apt install -y wget software-properties-common | |
wget -O - https://apt.llvm.org/llvm.sh | sudo bash | |
- name: Install dependencies | |
run: sudo apt update && sudo apt install -y clang-format-18 | |
- name: Combine includes and force push to main branch | |
run: | | |
git config --local user.name github-actions | |
git config --local user.email [email protected] | |
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@v2 | |
- name: Install dependencies | |
run: sudo apt install shfmt shellcheck | |
- name: shellcheck and shfmt | |
run: make --directory=tests/ shellcheck_shfmt |