diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml new file mode 100644 index 00000000..fc86c61d --- /dev/null +++ b/.github/workflows/e2e-test.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index ca69af18..90af41ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ @@ -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