Merge pull request #17 from lyuboangelov/feature/add-workflow

fix
This commit is contained in:
Lyuboslav Angelov 2023-11-14 13:40:43 +02:00 committed by GitHub
commit d7be67f3f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 31 deletions

View file

@ -9,40 +9,49 @@ on:
jobs:
hardhat-image-build:
if: ${{ github.event.label.name == 'CI:Deploy'}}
name: Build Hardhat image and push it to DockerHub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
# hardhat-image-build:
# if: ${{ github.event.label.name == 'CI:Deploy'}}
# name: Build Hardhat image and push it to DockerHub
# runs-on: ubuntu-latest
# steps:
# - name: Check out the repo
# uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN}}
# - name: Log in to Docker Hub
# uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN}}
- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: true
tags: "anglyuboslav/hardhat:${{ github.run_number }}"
# - name: Build and push Docker image
# uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
# with:
# context: .
# file: ./Dockerfile
# push: true
# tags: "anglyuboslav/hardhat:${{ github.run_number }}"
hardhat-env:
name: Build hardhat devnet
# name: Build hardhat devnet
# runs-on: ubuntu-latest
# services:
# go-eth:
# image: anglyuboslav/go-eth-lab:12
# hardhat:
# image: anglyuboslav/hardhat:1.0.0
# ports:
# - 8545:8545
# steps:
# - name: Run hardhat tests
# run: docker exec hardhat bash -c "npx hardhat test"
name: "Integration testing"
runs-on: ubuntu-latest
services:
go-eth:
image: anglyuboslav/go-eth-lab:12
hardhat:
image: anglyuboslav/hardhat:1.0.0
ports:
- 8545:8545
steps:
- name: Run hardhat tests
run: docker exec hardhat bash -c "npx hardhat test"
- uses: actions/checkout@v3
- name: "Set up environment"
run: docker compose -f docker-compose.yml up -d
# - name: "Wait for docker to finish building"
# run: sleep 30
- name: "Test server"
run: docker exec go-ethereum-lab-hardhat-1 npx hardhat test

View file

@ -4,3 +4,8 @@ services:
image: anglyuboslav/go-eth-lab
command:
- --dev
hardhat:
image: anglyuboslav/hardhat:1.0.0
ports:
- 8545:8545