Skip to content

Commit

Permalink
Merge pull request #308 from boltlabs-inc/ci-e2e
Browse files Browse the repository at this point in the history
Add new github action + workflow #288
  • Loading branch information
gijsvl authored Dec 2, 2021
2 parents e00621d + bbb90f5 commit e2d7c83
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: E2E tests

on:
schedule:
- cron: "0 12 * * 1"

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-docker-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-docker-${{ github.sha }}
${{ runner.os }}-buildx-docker-
${{ runner.os }}-
- uses: actions/checkout@v2
with:
submodules: recursive

- name: Prepare Tags
id: tags
run: |
TAG=$(echo $GITHUB_SHA | head -c7)
IMAGE="dev/test"
echo ::set-output name=tagged_image::${IMAGE}:${TAG}
echo ::set-output name=tag::${TAG}
- uses: docker/setup-buildx-action@v1
id: buildx

- name: Build
id: docker_build
uses: docker/build-push-action@v2
with:
file: ./Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: false
load: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
tags: ${{ steps.tags.outputs.tagged_image }}

- name: Run sandbox
run: docker run --rm --name my-sandbox --detach -p 20000:20000 tqtezos/flextesa:20210602 flobox start

- uses: addnab/docker-run-action@v3
with:
image: ${{ steps.tags.outputs.tagged_image }}
docker_network: host
run: |
tezos-client config reset
tezos-client --endpoint http://my-sandbox:20000 bootstrapped
tezos-client --endpoint http://my-sandbox:20000 config update
tezos-client import secret key alice unencrypted:edsk3QoqBuvdamxouPhin7swCvkQNgq4jP5KZPbwWNnwdZpSpJiEbq
tezos-client import secret key bob unencrypted:edsk3RFfvaFaxbHx8BMtEW1rKQcPtDML3LXjNqMNLCzC3wLC1bWbAt
cd dev
nohup python3 test-zeekoe.py merch-setup --url "http://my-sandbox:20000" -v &
nohup python3 test-zeekoe.py cust-setup --url "http://my-sandbox:20000" -v &
python3 test-zeekoe.py test-all
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ENV TZ=America/New_York
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update && apt-get install -y \
wget \
build-essential \
curl \
git-all \
Expand All @@ -31,4 +32,9 @@ WORKDIR /root/zeekoe
RUN git submodule update --init --recursive
RUN ./dev/generate-certificates; CARGO_NET_GIT_FETCH_WITH_CLI=true cargo build --features "allow_explicit_certificate_trust"

RUN wget https://github.com/serokell/tezos-packaging/releases/latest/download/tezos-client
RUN chmod +x tezos-client
RUN mkdir -p $HOME/.local/bin
RUN mv tezos-client /usr/local/bin

CMD bash

0 comments on commit e2d7c83

Please sign in to comment.