Skip to content

Commit

Permalink
Merge pull request #5907 from freedomofpress/codecov-barndoor-close
Browse files Browse the repository at this point in the history
Added codecov checksum validation, updated CircleCI machine to Focal.
  • Loading branch information
emkll committed Apr 22, 2021
2 parents 826c178 + 31b05b0 commit 14c9d3a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
8 changes: 7 additions & 1 deletion .circleci/config.yml
Expand Up @@ -97,6 +97,7 @@ version: 2
jobs:
lint:
machine:
image: ubuntu-2004:202010-01
enabled: true
environment:
DOCKER_API_VERSION: 1.23
Expand Down Expand Up @@ -124,6 +125,7 @@ jobs:

focal-app-tests:
machine:
image: ubuntu-2004:202010-01
enabled: true
environment:
DOCKER_API_VERSION: 1.23
Expand Down Expand Up @@ -157,6 +159,7 @@ jobs:

app-tests:
machine:
image: ubuntu-2004:202010-01
enabled: true
environment:
DOCKER_API_VERSION: 1.23
Expand Down Expand Up @@ -190,7 +193,7 @@ jobs:

translation-tests:
machine:
image: ubuntu-1604:202007-01
image: ubuntu-2004:202010-01
enabled: true
environment:
DOCKER_API_VERSION: 1.23
Expand Down Expand Up @@ -277,6 +280,7 @@ jobs:
static-analysis-and-no-known-cves:
machine:
image: ubuntu-2004:202010-01
enabled: true
environment:
DOCKER_API_VERSION: 1.23
Expand Down Expand Up @@ -306,6 +310,7 @@ jobs:
staging-test-with-rebase:
machine:
image: ubuntu-2004:202010-01
enabled: true

working_directory: ~/sd
Expand Down Expand Up @@ -337,6 +342,7 @@ jobs:

staging-test-with-rebase-focal:
machine:
image: ubuntu-2004:202010-01
enabled: true

working_directory: ~/sd
Expand Down
8 changes: 7 additions & 1 deletion securedrop/bin/dev-shell
Expand Up @@ -61,7 +61,13 @@ function docker_run() {

# If this is a CI run, pass CodeCov settings into the container.
if [ -n "${CIRCLE_BRANCH:-}" ] ; then
ci_env=$(bash <(curl -s https://codecov.io/env))
tmpdir=$(mktemp -d -t codecov-XXXX)
curl -s https://codecov.io/bash > "$tmpdir"/codecov;
curl -s https://codecov.io/env > "$tmpdir"/env;
VERSION="$(curl --silent "https://api.github.com/repos/codecov/codecov-bash/releases/latest" | grep '"tag_name":' |sed -E 's/.*"([^"]+)".*/\1/')"
curl -s https://raw.githubusercontent.com/codecov/codecov-bash/"${VERSION}"/SHA256SUM > "$tmpdir"/codecov-hashes
pushd "$tmpdir" && shasum -a 256 -c codecov-hashes && popd
ci_env=$(/bin/bash "$tmpdir"/env)
else
ci_env=""
fi
Expand Down
8 changes: 7 additions & 1 deletion securedrop/bin/run-test
Expand Up @@ -26,7 +26,13 @@ if [ -n "${CIRCLE_BRANCH:-}" ] ; then
touch tests/log/firefox.log
function finish {
cp tests/log/firefox.log ../test-results
bash <(curl -s https://codecov.io/bash -cF "$BASE_OS")
tmpdir=$(mktemp -d -t codecov-XXXX)
curl -s https://codecov.io/bash > "$tmpdir"/codecov;
VERSION="$(curl --silent "https://api.github.com/repos/codecov/codecov-bash/releases/latest" | grep '"tag_name":' |sed -E 's/.*"([^"]+)".*/\1/')"
curl -s https://raw.githubusercontent.com/codecov/codecov-bash/"${VERSION}"/SHA256SUM > "$tmpdir"/codecov-hashes
pushd "$tmpdir" && shasum -a 256 -c --ignore-missing codecov-hashes && popd
chmod +x "$tmpdir"/codecov
/bin/bash "$tmpdir"/codecov
}
trap finish EXIT
fi
Expand Down

0 comments on commit 14c9d3a

Please sign in to comment.