Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions upload-coverage/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ runs:

steps:
- run: |
cd ${{ inputs.project_dir }};
cd ${{ inputs.project_dir }}
# Restrict search to directories listed, if any.
directory_list="${{ inputs.directories }}";
dirs_opts="";
Expand All @@ -37,15 +37,18 @@ runs:
fi
# Generate the coverage report.
lcov --no-external --gcov-tool gcov ${dirs_opts} --capture --output-file lcov.info;
# Download the coverage export script.
curl --silent --output codecov --fail https://codecov.io/bash || \
curl -s -o codecov -f https://codecov.io/bash;
VERSION=$(grep -o 'VERSION=\"[0-9\.]*\"' codecov | cut -d'"' -f2);
for i in 1 256 512
do
shasum -a $i -c <(curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM" | grep codecov) || \
shasum -a $i -c <(curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM" | grep codecov)
done
# Effectively export the coverage report.
bash codecov -n "${{ inputs.name }}" -X gcov;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the new uploader supports -X gcov — do we need to do anything about this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the -X FEATURE argument in the documentation: https://docs.codecov.com/docs/codecov-uploader#uploader-command-line-arguments but I'm not sure the meaning is the same.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried grepping gcov in the repo of the source code for their new uploader, and it didn't look they support this option.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the description, -X gcov is supposed to "Disable uploading the file" gcov, if I understand it correctly. Maybe the pattern -X FEATURE is just inaccurate and FEATURE is just FILE/DIRECTORY?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the old uploader, -X gcov would disable running gcov (otherwise I think the uploader would run gcov in some circumstances).

In the new uploader, I think only -X network is supported. I don't think it does anything with gcov, so it's probably fine without the flag.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are probably right. In the description of the bash uploader (https://docs.codecov.com/docs/about-the-codecov-bash-uploader), the case of -X gcov is explicitly listed along with other possible values for FEATURE, so it looks like the new uploader supports just FEATURE=network.

# The variable $RUNNER_OS should be either "Linux" or "macOS"
os_lowercase=$(echo $RUNNER_OS | awk '{print tolower($0)}')
# The prefix will end with "linux" or "macos" depending on the runner OS
prefix="https://uploader.codecov.io/latest/$os_lowercase"
curl -Os "$prefix/codecov"
# Check integrity of the binary uploader (cf. https://docs.codecov.com/docs/codecov-uploader#integrity-checking-the-uploader)
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import # One-time step
curl -Os "$prefix/codecov.SHA256SUM"
curl -Os "$prefix/codecov.SHA256SUM.sig"
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
# Run the uploader
chmod +x codecov
./codecov -n "${{ inputs.name }}"
shell: bash