diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 2a1fcea690e..2dcfab3e3a7 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -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: @@ -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/action-post-run@2.0.1 with: @@ -90,7 +99,8 @@ jobs: coverage: name: coverage - runs-on: self-hosted + needs: configure + runs-on: [self-hosted, nebula] strategy: fail-fast: false matrix: @@ -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/action-post-run@2.0.1 with: diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 0669b472033..e6f55e7a125 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -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: @@ -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/action-post-run@2.0.1 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 37a29a70803..ef5d4d9ffca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: @@ -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