Skip to content

Commit

Permalink
Github tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
traiansf committed Dec 20, 2024
1 parent 1dfc846 commit a2ba817
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/actions/with-docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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} \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Dockerfile.k
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit a2ba817

Please sign in to comment.