Skip to content

Commit

Permalink
Debug3: try running as root
Browse files Browse the repository at this point in the history
Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
  • Loading branch information
christophebedard committed Feb 12, 2023
1 parent a528d73 commit ce987ca
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/build-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,20 @@ set -euxo pipefail

npm install -g codecov

whoami
id
ls -al dist/index.js
if [ -d /__w ]; then
chown -R 1001:1001 /__w
fi
ls -al dist/index.js

npm ci
# this runs 'ncc build' as user ID 1001
# but all other commands are run as root
# so just chown files to user 1001
npm run build
ls -al dist/index.js
npm test

# Upload code coverage to CodeCov, but do not fail the CI if CodeCov upload
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,12 @@ jobs:
runs-on: ubuntu-latest
container:
image: rostooling/setup-ros-docker:ubuntu-focal-latest
options: --user root
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3.6.0
with:
node-version: "16.x"
# /home/runner
- run: chown -R 1000:1000 /__w
- run: .github/workflows/build-and-test.sh
- uses: ./

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "lib/main.js",
"scripts": {
"prepare": "husky install",
"build": "ncc build src/setup-ros.ts -o dist",
"build": "id && ncc build src/setup-ros.ts -o dist",
"fixup": "eslint . --fix",
"lint": "eslint .",
"prettier": "prettier --write .",
Expand Down

0 comments on commit ce987ca

Please sign in to comment.