From 3710c179fe0d982f4cc995f006274d485579f0a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 14 Apr 2023 18:03:50 +0200 Subject: [PATCH] package/ci: adapt to arbitrary unnecessary Codecov breakages. --- package/ci/appveyor-desktop-mingw.bat | 12 ++++++++++- package/ci/appveyor.yml | 7 +++--- package/ci/circleci.yml | 31 +++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/package/ci/appveyor-desktop-mingw.bat b/package/ci/appveyor-desktop-mingw.bat index 0a1eae4ca..89260c348 100644 --- a/package/ci/appveyor-desktop-mingw.bat +++ b/package/ci/appveyor-desktop-mingw.bat @@ -74,4 +74,14 @@ cmake --build . --target install || exit /b rem Coverage upload set PATH=C:\msys64\usr\bin;%PATH% bash %APPVEYOR_BUILD_FOLDER%\package\ci\appveyor-lcov.sh || exit /b -codecov -f coverage.info -X gcov +rem The damn new codecov binary is apparently unable to work with +rem subdirectories on Windows. Nobody cares. +rem https://github.com/codecov/codecov-action/issues/862 +cd %APPVEYOR_BUILD_FOLDER% +move build\coverage.info coverage.info || exit /b +rem Official docs say "not needed for public repos", in reality not using the +rem token is "extremely flakey". What's best is that if the upload fails, the +rem damn thing exits with a success error code, and nobody cares: +rem https://github.com/codecov/codecov-circleci-orb/issues/139 +rem https://community.codecov.com/t/commit-sha-does-not-match-circle-build/4266 +codecov -f ./coverage.info -t 3b1a7cc0-8bfb-4cde-8d99-dc04572a43c3 -X gcov || exit /b diff --git a/package/ci/appveyor.yml b/package/ci/appveyor.yml index 9ff3c3e4b..9a0eda088 100644 --- a/package/ci/appveyor.yml +++ b/package/ci/appveyor.yml @@ -117,10 +117,11 @@ install: # Ninja. `cinst ninja` started 503ing in late November 2019 and wasn't really # reliable before either. So install by hand, as that's reliable always. - IF NOT EXIST %APPVEYOR_BUILD_FOLDER%\ninja-win.zip appveyor DownloadFile https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-win.zip -- 7z x ninja-win.zip -oC:/tools/ninja +- 7z x ninja-win.zip -oC:/tools +- set PATH=C:/tools;%PATH% -- set PATH=C:/tools/ninja;%PATH% -- IF "%TARGET%" == "desktop" IF "%COMPILER%" == "mingw" pip install codecov +# Codecov uploader +- IF "%TARGET%" == "desktop" IF "%COMPILER%" == "mingw" appveyor DownloadFile https://uploader.codecov.io/latest/windows/codecov.exe -FileName C:/tools/codecov.exe - IF "%TARGET_GLES2%" == "ON" set TARGET_GLES3=OFF - IF "%TARGET_GLES2%" == "OFF" set TARGET_GLES3=ON diff --git a/package/ci/circleci.yml b/package/ci/circleci.yml index e3e4ee7f5..d3ce05167 100644 --- a/package/ci/circleci.yml +++ b/package/ci/circleci.yml @@ -1,6 +1,14 @@ version: 2.1 orbs: + # Version 3.2.4 is the "new" uploader, but it's a 50 MB Node.js *binary* and + # doesn't work on ARM64 Linux (or ARM Macs, or FreeBSD for that matter) and + # nobody seems to care. Issues opened since Septembe 2021: + # https://github.com/codecov/uploader/issues/347 + # https://github.com/codecov/uploader/issues/523 + # https://github.com/codecov/uploader/issues/849 + # The old 1.1.1 still seems to work even though codecov got removed from pip + # on 2023-04-14. codecov: codecov/codecov@1.1.1 executors: @@ -45,6 +53,8 @@ commands: default: "" steps: - run: + # TODO when switching to the new codecov uploader, gpg and git needs to + # be installed as well name: Update apt and install base packages # Git is needed always for cloning Corrade command: | @@ -261,6 +271,27 @@ commands: lcov $LCOV_EXTRA_OPTS --remove coverage.info "*/MagnumExternal/*" --output-file coverage.info > /dev/null lcov $LCOV_EXTRA_OPTS --remove coverage.info "*/Test/*" --output-file coverage.info > /dev/null lcov $LCOV_EXTRA_OPTS --remove coverage.info "*/build/src/*" --output-file coverage.info > /dev/null + # Official docs say "token not needed for public repos", in reality not + # using the token is "extremely flakey". What's best is that if the upload + # fails, the damn thing exits with a success error code, and nobody cares: + # https://github.com/codecov/codecov-circleci-orb/issues/139 + # https://community.codecov.com/t/commit-sha-does-not-match-circle-build/4266 + # + # Second best thing is that the codecov/upload helper takes a `token` + # parameter. But the token parameter is an ENVIRONMENT VARIABLE NAME!! So + # one just *can't* pass the token there. It got changed arbitrarily in + # https://github.com/codecov/codecov-circleci-orb/pull/93 "because + # CircleCI docs suggested so", yet all codecov docs suggest just commiting + # that token directly to the YML files because "it's fine". So if it's + # fine, why do I have to suffer like this?! + - run: + name: Set codecov upload token because everything is a dumpster fire + # An icing on the cake is that CircleCI commands don't allow setting + # `environment` for `commands`, only for `jobs`, so I have to do that + # via bash, and because the environment isn't passsed from a run to + # run, use the BASH_ENV hack. Mmm. Technology. + command: | + echo 'export CODECOV_TOKEN=3b1a7cc0-8bfb-4cde-8d99-dc04572a43c3' >> "$BASH_ENV" - codecov/upload: file: coverage.info