aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/enochecker_test.yml
blob: 524d8bc0a688b44ddeb1fe0c4e60b08c87641c01 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: enochecker_test

on:
  push:
    branches:
      - "main"
  pull_request:
    branches:
      - "main"
  schedule:
    - cron: "0 0 * * *"

jobs:
  lint:
    runs-on: self-hosted
    steps:
      - uses: enowars/action-cleanup-runner@v1
      - uses: actions/checkout@v2
      - name: Set up Python 3.9
        uses: actions/setup-python@v2
        with:
          python-version: 3.9
      - name: Test checker style
        run: |
          cd checker
          pip install -r src/requirements.txt
          pip install -r dev-requirements.txt
          make lint
  build:
    runs-on: self-hosted
    env:
      ENOCHECKER_TEST_CHECKER_ADDRESS: localhost
      ENOCHECKER_TEST_CHECKER_PORT: 9091

    steps:
      - uses: enowars/action-cleanup-runner@v1
      - uses: actions/checkout@v2
      - 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 -d
      - name: Start checker
        run: |
          cd checker
          docker-compose up -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