Skip to content

Commit

Permalink
Fix CI (#382)
Browse files Browse the repository at this point in the history
* Work around 'npm run ...' executing as different user
* Remove codecov

Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
  • Loading branch information
christophebedard authored Aug 11, 2024
1 parent 1d11fe2 commit 97473ab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/build-and-test.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
#!/usr/bin/env bash
set -euxo pipefail

npm install -g codecov
# When running inside a Docker container, by default, we're root and all files belond to root.
# However, calling the npm scripts (build, etc.) with 'npm run ...' runs the commands as user
# ID=1001, which means we can't open or write to any files. Therefore, if we're in Docker, chown
# everything under /__w (which is the workspace directory on the host: /home/runner/work) to user
# ID=1001. See:
# * https://github.com/ros-tooling/setup-ros/pull/521
# * https://github.com/npm/cli/issues/4589
docker_workdir="/__w"
if [ -d "${docker_workdir}" ]; then
chown -R 1001:1001 "${docker_workdir}"
fi

npm ci
npm run build
npm test

# Upload code coverage result to Codecov
codecov -f ./coverage/coverage-final.json \
--disable=detect --commit="${GITHUB_SHA}" \
--branch="${GITHUB_REF#refs/heads/}"
3 changes: 0 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ on:
# Run the CI automatically every hour to look for flakyness.
- cron: '0 * * * *'

env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

jobs:
test_setup_ros:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 97473ab

Please sign in to comment.