From 2e2a60c0d7a209c06e436ae1e27dc6a8034ab8a1 Mon Sep 17 00:00:00 2001 From: Anton Sviridov Date: Wed, 26 Jun 2024 12:43:57 +0100 Subject: [PATCH] Cleanup --- .github/workflows/build-env-docker.yml | 4 ++++ .github/workflows/protobuf-reprolang.yml | 5 ++++- dev/docker-entrypoint.sh | 16 ---------------- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-env-docker.yml b/.github/workflows/build-env-docker.yml index 36dec76b..1f2c929b 100644 --- a/.github/workflows/build-env-docker.yml +++ b/.github/workflows/build-env-docker.yml @@ -27,6 +27,9 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. - name: Log in to the Container registry uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 @@ -55,6 +58,7 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64 # This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see "[AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)." - name: Generate artifact attestation diff --git a/.github/workflows/protobuf-reprolang.yml b/.github/workflows/protobuf-reprolang.yml index 23c1d33c..654ad22e 100644 --- a/.github/workflows/protobuf-reprolang.yml +++ b/.github/workflows/protobuf-reprolang.yml @@ -28,6 +28,9 @@ jobs: - run: docker pull ghcr.io/sourcegraph/scip:latest || echo "no suitable cache" - - run: sudo chown -R 1001:1001 . && ./dev/generate-all-in-docker.sh + - run: | + # We're changing the owner of the checkout folder to a particular user id, + # matching the user id of `asdf` user we create inside the docker container. + sudo chown -R 1001:1001 . && ./dev/generate-all-in-docker.sh - run: git diff --exit-code diff --git a/dev/docker-entrypoint.sh b/dev/docker-entrypoint.sh index 452074e1..557e5cea 100755 --- a/dev/docker-entrypoint.sh +++ b/dev/docker-entrypoint.sh @@ -2,22 +2,6 @@ set -xeuo pipefail -# We're explicitly overriding the node_modules location used by Yarn because -# of issues when mounting node_modules inside the docker container AND running -# it under non-root user. - -# Symlinking won't work: https://github.com/yarnpkg/yarn/issues/8079#issuecomment-622817604 -# node_modules mounting is a known issue: https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder - -CUSTOM_NODE_MODULES="$HOME/my-node-modules" - -mkdir -p $CUSTOM_NODE_MODULES && chmod 0777 $CUSTOM_NODE_MODULES && chown -R asdf:asdf $CUSTOM_NODE_MODULES - -echo "--modules-folder $CUSTOM_NODE_MODULES" > $HOME/.yarnrc - -export PATH="$PATH:$CUSTOM_NODE_MODULES/.bin" -export NODE_PATH="$CUSTOM_NODE_MODULES" - ./dev/proto-generate.sh ./cmd/scip/tests/reprolang/generate-tree-sitter-parser.sh