diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 00000000..9c545fc6 --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,15 @@ +name: 'Install LLVM' +runs: + using: "composite" + steps: + - name: Install LLVM + shell: bash + run: | + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 22 + sudo apt-get update + sudo apt-get install -y clang-format-22 clang-tidy-22 + clang-22 --version + clang-format-22 --version + clang-tidy-22 --version diff --git a/.github/workflows/programming_team_code_ci.yml b/.github/workflows/programming_team_code_ci.yml index e57b32b8..563f0f51 100644 --- a/.github/workflows/programming_team_code_ci.yml +++ b/.github/workflows/programming_team_code_ci.yml @@ -35,17 +35,9 @@ jobs: 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 + - uses: ./.github/actions/setup - name: Install dependencies - run: sudo apt install -y clang-format-22 cppcheck - - name: Verify - run: | - clang-22 --version - clang-format-22 --version + run: sudo apt install -y cppcheck - name: grep, clang-format, cppcheck run: make --directory=tests/ grep_clangformat_cppcheck @@ -53,17 +45,7 @@ jobs: 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 + - uses: ./.github/actions/setup - name: clang-tidy run: make --directory=tests/ clangtidy @@ -78,14 +60,7 @@ jobs: 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 + - uses: ./.github/actions/setup - name: g++ with clang run: make --directory=tests/ compile_clang @@ -100,17 +75,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: ./.github/actions/setup - 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 + run: sudo apt install texlive texlive-latex-extra rename nodejs npm - name: build pdf run: make --directory=tests/ build_pdf - uses: actions/upload-artifact@v4 @@ -142,17 +109,7 @@ jobs: 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 + - uses: ./.github/actions/setup - name: Combine includes and force push to main branch run: | git config --local user.name github-actions diff --git a/.verify-helper/timestamps.remote.json b/.verify-helper/timestamps.remote.json index 0a14faf8..fbe4997b 100644 --- a/.verify-helper/timestamps.remote.json +++ b/.verify-helper/timestamps.remote.json @@ -5,7 +5,7 @@ "tests/library_checker_aizu_tests/convolution/xor_convolution.test.cpp": "2026-03-06 12:17:28 -0700", "tests/library_checker_aizu_tests/data_structures/binary_search_example.test.cpp": "2024-11-18 10:51:39 -0600", "tests/library_checker_aizu_tests/data_structures/binary_trie.test.cpp": "2026-01-18 02:20:40 +0000", -"tests/library_checker_aizu_tests/data_structures/bit.test.cpp": "2026-04-06 12:17:32 -0600", +"tests/library_checker_aizu_tests/data_structures/bit.test.cpp": "2026-04-12 11:07:55 -0600", "tests/library_checker_aizu_tests/data_structures/bit_inc.test.cpp": "2026-04-06 12:17:32 -0600", "tests/library_checker_aizu_tests/data_structures/bit_inc_walk.test.cpp": "2026-04-06 12:17:32 -0600", "tests/library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp": "2026-04-06 12:17:32 -0600", @@ -147,5 +147,4 @@ "tests/library_checker_aizu_tests/trees/lca_all_methods_aizu.test.cpp": "2026-04-06 14:41:55 -0600", "tests/library_checker_aizu_tests/trees/lca_all_methods_lib_checker.test.cpp": "2026-04-06 14:41:55 -0600", "tests/library_checker_aizu_tests/trees/shallowest_aizu_tree_height.test.cpp": "2026-04-12 10:51:29 -0600", -"tests/library_checker_aizu_tests/trees/subtree_isomorphism.test.cpp": "2026-04-06 14:41:55 -0600" } \ No newline at end of file diff --git a/tests/library_checker_aizu_tests/data_structures/bit.test.cpp b/tests/library_checker_aizu_tests/data_structures/bit.test.cpp index 3f80ba46..3f32e9e2 100644 --- a/tests/library_checker_aizu_tests/data_structures/bit.test.cpp +++ b/tests/library_checker_aizu_tests/data_structures/bit.test.cpp @@ -48,7 +48,7 @@ int main() { assert(res == bit_rr.query(l, r)); cout << res << '\n'; } - auto sum = rnd(0LL, (ll)(1e12)); + auto sum = rnd(0LL, (ll)1e12); auto need = sum; auto f = [&](ll x, int tl, int tr) -> bool { assert(tl <= tr); diff --git a/tests/library_checker_aizu_tests/trees/shallowest_lib_checker_tree_path_composite.test.cpp b/tests/library_checker_aizu_tests/trees/shallowest_lib_checker_tree_path_composite.test.cpp index 3bf75f7f..dd174ba1 100644 --- a/tests/library_checker_aizu_tests/trees/shallowest_lib_checker_tree_path_composite.test.cpp +++ b/tests/library_checker_aizu_tests/trees/shallowest_lib_checker_tree_path_composite.test.cpp @@ -87,8 +87,7 @@ int main() { for (int v : adj[cent]) { for (int i = 0; i < ssize(adj[v]); i++) { if (adj[v][i] == cent) { - swap(weight[v][i], weight[v].back()); - weight[v].pop_back(); + weight[v].erase(begin(weight[v]) + i); break; } }