Skip to content

Commit

Permalink
Create enochecker_test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
MoaathOudeh authored Jun 6, 2024
1 parent 4f41dcb commit 3a1941e
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/enochecker_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: enochecker_test

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: self-hosted
env:
ENOCHECKER_TEST_CHECKER_ADDRESS: localhost
ENOCHECKER_TEST_CHECKER_PORT: 18080

steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install enochecker_test
run: |
python -m pip install --upgrade pip
pip install enochecker-test
- name: start service
run: |
cd service
docker-compose up --build --force-recreate -d
- name: start checker
run: |
cd checker
docker-compose up --build --force-recreate -d
- name: obtain Docker host IP
run: |
echo "ENOCHECKER_TEST_SERVICE_ADDRESS=$(ip -4 address show dev eth0 | grep inet | awk '{ print $2 }' | sed 's|/.*$||')" >> $GITHUB_ENV
- name: run enochecker_test
run: |
enochecker_test
- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v1
with:
dest: './logs'
- name: Tar logs
if: failure()
run: tar cvzf ./logs.tgz ./logs
- name: Upload logs to GitHub
if: failure()
uses: actions/upload-artifact@master
with:
name: logs.tgz
path: ./logs.tgz
- name: Kill docker containers
if: failure() || success()
run: |
(cd service && docker-compose kill)
(cd checker && docker-compose kill)

0 comments on commit 3a1941e

Please sign in to comment.