.github/workflows/run_tests_in_docker.yml
author Edouard Tisserant <edouard.tisserant@gmail.com>
Wed, 05 Oct 2022 16:10:17 +0200
branchwxPython4
changeset 3617 c3aae4c95bc1
parent 3560 f0ed67b01a9d
child 3632 92bfefddae27
permissions -rw-r--r--
Runtime: work around 1s delay added when using twisted reactor's callLater.

Since wxPython4, using wxReactor from non-main thread was producing
exceptions in wxWidget's C++ code. Then reactor.run() was called from
main thread, and runtime's worker was delegating calls to reactor
with callLater(0, callable).

While this worked perfectly with wxReactor, it did introduce an unexplained
1 second delay to each worker call when using nomal linux reactors
(i.e. without wxPython). As a workaround reactor runs in a thread when using
twisted without wxPython
name: Docker Image CI

on:
  push:
    branches: [ wxPython4 ]

jobs:

  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
      with:
          path: beremiz

    - uses: actions/checkout@v3
      with:
          repository: beremiz/matiec
          ref: 2a25f4dbf4e2b1e017a3a583db7dede4771fe523
          path: matiec

    - uses: actions/checkout@v3
      with:
          repository: open62541/open62541
          ref: v1.3.2
          path: open62541
          submodules: recursive

    - name: Cache docker image
      id: cache-docker
      uses: actions/cache@v3
      env:
        cache-name: cache-docker
      with:
        path: /tmp/latest.tar
        key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('beremiz/tests/tools/Docker/beremiz-sikuli') }}

    - if: ${{ steps.cache-docker.outputs.cache-hit == false }}
      name: Create docker image
      run: |
        cd beremiz/tests/tools/Docker/beremiz-sikuli
        ./build_docker_image.sh
        docker image save --output="/tmp/latest.tar" beremiz_sikuli

    - if: ${{ steps.cache-docker.outputs.cache-hit != false }}
      name: Re-use docker image
      run: |
        docker image load --input="/tmp/latest.tar" 

    - name: Create docker container
      run: |
        cd beremiz/tests/tools/Docker/beremiz-sikuli
        ./create_docker_container.sh ${{ github.workspace }}/test
        
    - name: Run tests in docker
      run: |
        cd beremiz/tests/tools/Docker/beremiz-sikuli
        ./do_test_in_docker.sh

    - name: Upload test resuts artifact
      uses: actions/upload-artifact@v3
      if: failure()
      with:
        name: test_results
        path: ${{ github.workspace }}/test
        retention-days: 5