From a2ba817fa8cd8ec594624c856c9e1a331dcd0b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Traian-Florin=20=C8=98erb=C4=83nu=C8=9B=C4=83?= Date: Fri, 20 Dec 2024 20:57:32 +0200 Subject: [PATCH] Github tokens --- .github/actions/with-docker/action.yml | 3 ++- .github/workflows/Dockerfile.k | 2 +- .github/workflows/test-pr.yml | 8 ++++---- Makefile | 9 ++++++--- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/actions/with-docker/action.yml b/.github/actions/with-docker/action.yml index 98bf9115d..e1ed46438 100644 --- a/.github/actions/with-docker/action.yml +++ b/.github/actions/with-docker/action.yml @@ -11,13 +11,14 @@ runs: shell: bash {0} env: CONTAINER_NAME: ${{ inputs.container-name }} + GITHUB_TOKEN: ${{ github.token }} run: | set -euxo pipefail TAG=runtimeverificationinc/${CONTAINER_NAME} K_COMMIT=$(cat ./deps/k_release) - docker build -f .github/workflows/Dockerfile.k . --tag ${TAG} --build-arg K_COMMIT=${K_COMMIT} + docker build -f .github/workflows/Dockerfile.k . --tag ${TAG} --build-arg K_COMMIT=${K_COMMIT} GITHUB_TOKEN=${GITHUB_TOKEN} docker run \ --name ${CONTAINER_NAME} \ diff --git a/.github/workflows/Dockerfile.k b/.github/workflows/Dockerfile.k index 4564d3c48..fb254ac8d 100644 --- a/.github/workflows/Dockerfile.k +++ b/.github/workflows/Dockerfile.k @@ -98,7 +98,7 @@ RUN pip3 install --user \ numpy # Install K -RUN git clone --depth=1 --branch v${K_COMMIT} https://${GITHUB_TOKEN}@${KFRAMEWORK_REPO} k +RUN git clone --depth=1 --branch v${K_COMMIT} https://${KFRAMEWORK_REPO} k RUN cd k && git submodule update --init --recursive ENV CXXFLAGS=-fvisibility=hidden RUN cd k && mvn package -Dhaskell.backend.skip -DskipTests diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index de00b3a14..fc00a323a 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -76,13 +76,13 @@ jobs: with: container-name: kwasm-ci-erc20-${{ github.sha }} - name: 'Build everything' - run: docker exec -u user kwasm-ci-erc20-${GITHUB_SHA} make ulm-wasm ulm-contract-compiler ulm-build erc20-bin -j13 + run: docker exec -u user kwasm-ci-erc20-${GITHUB_SHA} bash -c "CXX=clang++-16 make ulm-wasm ulm-contract-compiler ulm-build erc20-bin" - name: 'Start server' - run: docker exec -u user kwasm-ci-erc20-${GITHUB_SHA} -d ./scripts/run-dev-ulm + run: docker exec -u user kwasm-ci-erc20-${GITHUB_SHA} -d bash -c "./scripts/run-dev-ulm" - name: 'Load kwasm library' - run: docker exec -u user kwasm-ci-erc20-${GITHUB_SHA} ./scripts/ulm-load-lang + run: docker exec -u user kwasm-ci-erc20-${GITHUB_SHA} bash -c "./scripts/ulm-load-lang" - name: 'Run ERC20 tests' - run: docker exec -u user kwasm-ci-erc20-${GITHUB_SHA} tests/ulm/erc20/erc20_test.sh + run: docker exec -u user kwasm-ci-erc20-${GITHUB_SHA} bash -c "tests/ulm/erc20/erc20_test.sh" - name: 'Tear down Docker' if: always() run: | diff --git a/Makefile b/Makefile index 6aabc2151..0266067a7 100644 --- a/Makefile +++ b/Makefile @@ -80,12 +80,15 @@ ULM_SRC_HOOKS=$(shell find "$(ULM_CLONE_DIR)/kllvm" -type f -a '(' -name '*.cpp' ULM_GETH_TARGET=$(ULM_BUILD_DIR)/geth +GITHUB_TOKEN:=$(shell cat ~/.github-auth-token) +GITHUB_PREFIX:=$(if $(GITHUB_TOKEN),https://$(GITHUB_TOKEN)@github.com,https://github.com) + ### ULM Crypto Plugin $(ULM_KRYPTO_DIR)/.git: @mkdir -p $(ULM_DEP_DIR) cd $(ULM_DEP_DIR); \ - git clone --depth 1 https://github.com/runtimeverification/blockchain-k-plugin plugin; \ + git clone --depth 1 $(GITHUB_PREFIX)/runtimeverification/blockchain-k-plugin plugin; \ cd plugin; \ git submodule update --init --recursive @@ -102,7 +105,7 @@ ulm-krypto-build: $(ULM_KRYPTO_TARGET) $(ULM_CLONE_DIR)/.git: @mkdir -p $(ULM_DEP_DIR) cd $(ULM_DEP_DIR); \ - git clone --depth 1 --branch contract-size-limits https://github.com/pi-squared-inc/ulm + git clone --depth 1 --branch contract-size-limits $(GITHUB_PREFIX)/pi-squared-inc/ulm $(ULM_HOOKS_TARGET): $(ULM_SRC_HOOKS) | $(ULM_CLONE_DIR)/.git @mkdir -p $(ULM_LIB_DIR) @@ -119,7 +122,7 @@ ulm-hooks-build: $(ULM_HOOKS_TARGET) $(ULM_KEVM_DIR)/.git: @mkdir -p $(ULM_DEP_DIR) cd $(ULM_DEP_DIR); \ - git clone --depth 1 https://github.com/pi-squared-inc/evm-semantics -b $(ULM_KEVM_BRANCH) evm-semantics + git clone --depth 1 $(GITHUB_PREFIX)/pi-squared-inc/evm-semantics -b $(ULM_KEVM_BRANCH) evm-semantics $(ULM_KEVM_TARGET): $(ULM_KRYPTO_TARGET) $(ULM_HOOKS_TARGET) | $(ULM_KEVM_DIR)/.git @mkdir -p $(ULM_LIB_DIR)