Skip to content

Commit

Permalink
Configure uid and gid
Browse files Browse the repository at this point in the history
  • Loading branch information
yixinglu committed Nov 8, 2021
1 parent 47f1fc3 commit cfc1436
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 9 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,18 @@ defaults:
shell: bash

jobs:
configure:
runs-on: [self-hosted, nebula]
outputs:
uid_gid: ${{ steps.get-user.outputs.uid_gid }}
steps:
- id: get-user
run: echo "::set-output name=uid_gid::$(id -u):$(id -g)"

package:
name: build package
runs-on: self-hosted
needs: configure
runs-on: [self-hosted, nebula]
strategy:
fail-fast: false
matrix:
Expand All @@ -28,7 +37,7 @@ jobs:
- centos8
container:
image: vesoft/nebula-dev:${{ matrix.os }}
options: --user "$(id -u):$(id -g)"
options: --user ${{ needs.configure.outputs.uid_gid }}
steps:
- uses: webiny/[email protected]
with:
Expand Down Expand Up @@ -90,7 +99,8 @@ jobs:

coverage:
name: coverage
runs-on: self-hosted
needs: configure
runs-on: [self-hosted, nebula]
strategy:
fail-fast: false
matrix:
Expand All @@ -105,7 +115,7 @@ jobs:
CCACHE_MAXSIZE: 8G
volumes:
- /tmp/ccache/nebula/${{ matrix.os }}-${{ matrix.compiler }}:/tmp/ccache/nebula/${{ matrix.os }}-${{ matrix.compiler }}
options: --cap-add=SYS_PTRACE --user "$(id -u):$(id -g)"
options: --cap-add=SYS_PTRACE --user ${{ needs.configure.outputs.uid_gid }}
steps:
- uses: webiny/[email protected]
with:
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,19 @@ jobs:
- name: Check Gherkin feature format
run: make check -C tests

configure:
needs: lint
runs-on: [self-hosted, nebula]
outputs:
uid_gid: ${{ steps.get-user.outputs.uid_gid }}
steps:
- id: get-user
run: echo "::set-output name=uid_gid::$(id -u):$(id -g)"

build:
name: build
needs: lint
runs-on: self-hosted
needs: configure
runs-on: [self-hosted, nebula]
strategy:
fail-fast: false
matrix:
Expand All @@ -65,7 +74,7 @@ jobs:
image: vesoft/nebula-dev:${{ matrix.os }}
volumes:
- /tmp/ccache/nebula/${{ matrix.os }}-${{ matrix.compiler }}:/tmp/ccache/nebula/${{ matrix.os }}-${{ matrix.compiler }}
options: --cap-add=SYS_PTRACE --user "$(id -u):$(id -g)"
options: --cap-add=SYS_PTRACE --user ${{ needs.configure.outputs.uid_gid }}
steps:
- uses: webiny/[email protected]
with:
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,18 @@ defaults:
shell: bash

jobs:
configure:
runs-on: [self-hosted, nebula]
outputs:
uid_gid: ${{ steps.get-user.outputs.uid_gid }}
steps:
- id: get-user
run: echo "::set-output name=uid_gid::$(id -u):$(id -g)"

package:
name: build package
runs-on: self-hosted
runs-on: [self-hosted, nebula]
needs: configure
strategy:
fail-fast: false
matrix:
Expand All @@ -28,7 +37,7 @@ jobs:
- centos8
container:
image: vesoft/nebula-dev:${{ matrix.os }}
options: --user "$(id -u):$(id -g)"
options: --user ${{ needs.configure.outputs.uid_gid }}
env:
BUILD_DIR: ./pkg-build
CPACK_DIR: ./pkg-build/cpack_output
Expand Down

0 comments on commit cfc1436

Please sign in to comment.