diff --git a/.github/workflows/lua-cov.yml b/.github/workflows/lua-cov.yml index a089916f..6ede7670 100644 --- a/.github/workflows/lua-cov.yml +++ b/.github/workflows/lua-cov.yml @@ -27,6 +27,8 @@ jobs: - run: lua -v && make lu_test COV=true - - run: find ./lua -print | sort - - - run: bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }} -F Lua + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + flags: Lua \ No newline at end of file diff --git a/README.rst b/README.rst index 6d7e5fbe..9adf606d 100644 --- a/README.rst +++ b/README.rst @@ -45,6 +45,8 @@ Olivia's Project Euler Solutions :target: https://app.codecov.io/github/LivInTheLookingGlass/Euler?flags%5B0%5D=Java .. |Js-Cov| image:: https://img.shields.io/codecov/c/github/LivInTheLookingGlass/Euler?flag=JavaScript&logo=codecov&label=Js%20Cov :target: https://app.codecov.io/github/LivInTheLookingGlass/Euler?flags%5B0%5D=JavaScript +.. |Lu-Cov| image:: https://img.shields.io/codecov/c/github/LivInTheLookingGlass/Euler?flag=Lua&logo=codecov&label=Lu%20Cov + :target: https://app.codecov.io/github/LivInTheLookingGlass/Euler?flags%5B0%5D=Lua .. |Py-Cov| image:: https://img.shields.io/codecov/c/github/LivInTheLookingGlass/Euler?flag=Python&logo=codecov&label=Py%20Cov :target: https://app.codecov.io/github/LivInTheLookingGlass/Euler?flags%5B0%5D=Python .. |Rs-Cov| image:: https://img.shields.io/codecov/c/github/LivInTheLookingGlass/Euler?flag=Rust&logo=codecov&label=Rs%20Cov @@ -94,6 +96,7 @@ Olivia's Project Euler Solutions | | | | |ESLint| | +------------+----------------------------+--------+-------------------+ | Lua | Lua 5+ [#]_ | 12 | |Luai| |br| | + | | | | |Lu-Cov| |br| | | | | | |LuaCheck| | +------------+----------------------------+--------+-------------------+ | Python | CPython 3.6+ |br| | 80 | |Python| |br| | diff --git a/c/README.rst b/c/README.rst index 4d7d54cf..f2174242 100644 --- a/c/README.rst +++ b/c/README.rst @@ -1,14 +1,18 @@ C Section ========= -.. |C Check| image:: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/c.yml/badge.svg +.. |Ci| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/c.yml?logo=github&label=C%20Tests :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/c.yml +.. |C-lint| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/c-lint.yml?logo=github&label=Linting + :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/c-lint.yml +.. |CodeQL| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/codeql.yml?logo=github&label=CodeQL + :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/codeql.yml +.. |C-Cov| image:: https://img.shields.io/codecov/c/github/LivInTheLookingGlass/Euler?flag=C&logo=codecov&label=C%20Cov + :target: https://app.codecov.io/github/LivInTheLookingGlass/Euler?flags%5B0%5D=C -|C Check| +|Ci| |C-Cov| |C-lint| |CodeQL| -All problems are solved in C11, though most if not all of it is -C99-compatible. It is tested on clang, gcc, pcc, tcc, and msvc (the Visual Studios -compiler). +All problems are solved in C99. It is tested on clang, gcc, pcc, tcc, and msvc (the Visual Studios compiler). Organization ------------ diff --git a/cplusplus/README.rst b/cplusplus/README.rst index e8df89d8..7b0d3bee 100644 --- a/cplusplus/README.rst +++ b/cplusplus/README.rst @@ -1,10 +1,16 @@ C++ Section =========== -.. |C++ Check| image:: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/cplusplus.yml/badge.svg +.. |Cpi| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/cplusplus.yml?logo=github&label=Cpp%20Tests :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/cplusplus.yml - -|C++ Check| +.. |Cp-lint| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/cplusplus-lint.yml?logo=github&label=Linting + :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/cplusplus-lint.yml +.. |CodeQL| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/codeql.yml?logo=github&label=CodeQL + :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/codeql.yml +.. |Cp-Cov| image:: https://img.shields.io/codecov/c/github/LivInTheLookingGlass/Euler?flag=Cpp&logo=codecov&label=Cpp%20Cov + :target: https://app.codecov.io/github/LivInTheLookingGlass/Euler?flags%5B0%5D=Cpp + +|Cpi| |Cp-Cov| |Cp-lint| |CodeQL| All problems are solved in C++98. It is tested on clang, g++, and msvc (the Visual Studios compiler). diff --git a/csharp/README.rst b/csharp/README.rst index fd74c365..dda48701 100644 --- a/csharp/README.rst +++ b/csharp/README.rst @@ -1,10 +1,16 @@ C# Section ========== -.. |C# Check| image:: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/csharp.yml/badge.svg +.. |C#i| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/csharp.yml?logo=github&label=C%23%20Tests :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/csharp.yml - -|C# Check| +.. |C#-lint| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/csharp-lint.yml?logo=github&label=Linting + :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/csharp-lint.yml +.. |CodeQL| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/codeql.yml?logo=github&label=CodeQL + :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/codeql.yml +.. |Cs-Cov| image:: https://img.shields.io/codecov/c/github/LivInTheLookingGlass/Euler?flag=Csharp&logo=codecov&label=C%23%20Cov + :target: https://app.codecov.io/github/LivInTheLookingGlass/Euler?flags%5B0%5D=Csharp + +|C#i| |Cs-Cov| |C#-lint| |CodeQL| All problems are solved in .NET 2+. diff --git a/java/README.rst b/java/README.rst index 46d5aa47..e9606dbf 100644 --- a/java/README.rst +++ b/java/README.rst @@ -1,10 +1,16 @@ Java Section ============ -.. |Java Check| image:: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/java.yml/badge.svg +.. |Javai| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/java.yml?logo=github&label=Java%20Tests :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/java.yml - -|Java Check| +.. |Java-lint| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/java-lint.yml?logo=github&label=Linting + :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/java-lint.yml +.. |CodeQL| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/codeql.yml?logo=github&label=CodeQL + :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/codeql.yml +.. |Ja-Cov| image:: https://img.shields.io/codecov/c/github/LivInTheLookingGlass/Euler?flag=Java&logo=codecov&label=Java%20Cov + :target: https://app.codecov.io/github/LivInTheLookingGlass/Euler?flags%5B0%5D=Java + +|Javai| |Ja-Cov| |Java-lint| |CodeQL| All problems are solved in Java 8+. diff --git a/javascript/README.rst b/javascript/README.rst index eab55a1c..f6ecc669 100644 --- a/javascript/README.rst +++ b/javascript/README.rst @@ -1,10 +1,16 @@ JavaScript Section ================== -.. |JavaScript Check| image:: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/javascript.yml/badge.svg +.. |JavaScript| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/javascript.yml?logo=github&label=Js%20Tests :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/javascript.yml - -|JavaScript Check| +.. |ESLint| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/eslint.yml?logo=github&label=ESLint + :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/eslint.yml +.. |Js-Cov| image:: https://img.shields.io/codecov/c/github/LivInTheLookingGlass/Euler?flag=JavaScript&logo=codecov&label=Js%20Cov + :target: https://app.codecov.io/github/LivInTheLookingGlass/Euler?flags%5B0%5D=JavaScript +.. |CodeQL| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/codeql.yml?logo=github&label=CodeQL + :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/codeql.yml + +|JavaScript| |Js-Cov| |ESLint| |CodeQL| All problems are solved in ES6+ Javascript diff --git a/lua/README.rst b/lua/README.rst index fdda106b..d96dfa0c 100644 --- a/lua/README.rst +++ b/lua/README.rst @@ -5,8 +5,10 @@ Lua Section :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/lua.yml .. |LuaCheck| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/lua-lint.yml?logo=github&label=LuaCheck :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/lua-lint.yml +.. |Lu-Cov| image:: https://img.shields.io/codecov/c/github/LivInTheLookingGlass/Euler?flag=Lua&logo=codecov&label=Lu%20Cov + :target: https://app.codecov.io/github/LivInTheLookingGlass/Euler?flags%5B0%5D=Lua -|Luai| |LuaCheck| +|Luai| |LuaCheck| |Lu-Cov| Organization ------------ diff --git a/lua/test.lua b/lua/test.lua index 37652318..06a19a55 100644 --- a/lua/test.lua +++ b/lua/test.lua @@ -46,6 +46,10 @@ end local function check_problem(file_name, expected_answer, is_slow, problem_name) print("Starting: " .. file_name) local problem_func = load_problem("src/" .. file_name) + if is_slow and has_luacov + then + return + end local start_time = os.clock() local success, result = pcall(problem_func) local elapsed_time = os.clock() - start_time @@ -61,7 +65,7 @@ local function check_problem(file_name, expected_answer, is_slow, problem_name) ) end - if not is_slow and not has_luacov and elapsed_time > 60 then + if not is_slow and elapsed_time > 60 then error( "Problem " .. problem_name .. " took ~" .. string.format("%.3f", elapsed_time) .. "s, exceeding the expected time limit of 60s." @@ -96,11 +100,8 @@ for file_name, config in pairs(problems) do end -- Slow testing loop -if not has_luacov -then - for file_name, config in pairs(problems) do - if config[2] then - check_problem(file_name, config[1], config[2], file_name:match("(%d+)")) - end +for file_name, config in pairs(problems) do + if config[2] then + check_problem(file_name, config[1], config[2], file_name:match("(%d+)")) end end diff --git a/python/README.rst b/python/README.rst index 26e60980..2295366b 100644 --- a/python/README.rst +++ b/python/README.rst @@ -1,10 +1,16 @@ Python Section ============== -.. |Python Check| image:: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/python.yml/badge.svg +.. |Python| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/python.yml?logo=github&label=Py%20Tests :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/python.yml - -|Python Check| +.. |PythonLint| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/python-lint.yml?logo=github&label=Linting + :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/python-lint.yml +.. |Py-Cov| image:: https://img.shields.io/codecov/c/github/LivInTheLookingGlass/Euler?flag=Python&logo=codecov&label=Py%20Cov + :target: https://app.codecov.io/github/LivInTheLookingGlass/Euler?flags%5B0%5D=Python +.. |CodeQL| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/codeql.yml?logo=github&label=CodeQL + :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/codeql.yml + +|Python| |Py-Cov| |PythonLint| |CodeQL| All problems are solved in type-hinted python3 diff --git a/rust/README.rst b/rust/README.rst index 1b68a21a..ab3a2524 100644 --- a/rust/README.rst +++ b/rust/README.rst @@ -1,10 +1,14 @@ Rust Section ============ -.. |Rust Check| image:: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/rust.yml/badge.svg +.. |Rust| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/rust.yml?logo=github&label=Rs%20Tests :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/rust.yml +.. |RustClippy| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/rust-clippy.yml?logo=github&label=Clippy + :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/rust-clippy.yml +.. |Rs-Cov| image:: https://img.shields.io/codecov/c/github/LivInTheLookingGlass/Euler?flag=Rust&logo=codecov&label=Rs%20Cov + :target: https://app.codecov.io/github/LivInTheLookingGlass/Euler?flags%5B0%5D=Rust -|Rust Check| +|Rust| |Rs-Cov| |RustClippy| Organization ------------