.github/workflows/run_tests_in_docker.yml
author Edouard Tisserant <edouard.tisserant@gmail.com>
Sat, 20 May 2023 00:37:31 +0200
changeset 3811 fcd2826f5c9e
parent 3700 302492568cf4
child 3827 50e79436f9b4
permissions -rw-r--r--
Fix bytes/string confusion with Logging
3456
c0a41c2d0dd1 Create run_tests_in_docker.yml
etisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     1
name: Docker Image CI
c0a41c2d0dd1 Create run_tests_in_docker.yml
etisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     2
c0a41c2d0dd1 Create run_tests_in_docker.yml
etisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     3
on:
c0a41c2d0dd1 Create run_tests_in_docker.yml
etisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     4
  push:
c0a41c2d0dd1 Create run_tests_in_docker.yml
etisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     5
    branches: [ wxPython4 ]
c0a41c2d0dd1 Create run_tests_in_docker.yml
etisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     6
c0a41c2d0dd1 Create run_tests_in_docker.yml
etisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     7
jobs:
c0a41c2d0dd1 Create run_tests_in_docker.yml
etisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     8
c0a41c2d0dd1 Create run_tests_in_docker.yml
etisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     9
  build:
c0a41c2d0dd1 Create run_tests_in_docker.yml
etisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    10
3700
302492568cf4 Backed out changeset ddadbdf20e70, no effect on current problem.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3699
diff changeset
    11
    runs-on: ubuntu-latest
3456
c0a41c2d0dd1 Create run_tests_in_docker.yml
etisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    12
c0a41c2d0dd1 Create run_tests_in_docker.yml
etisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    13
    steps:
c0a41c2d0dd1 Create run_tests_in_docker.yml
etisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    14
    - uses: actions/checkout@v3
3459
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    15
      with:
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    16
          path: beremiz
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    17
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    18
    - uses: actions/checkout@v3
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    19
      with:
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    20
          repository: beremiz/matiec
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    21
          ref: 2a25f4dbf4e2b1e017a3a583db7dede4771fe523
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    22
          path: matiec
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    23
3549
0af7b6a96c53 CLI: fix fake_wx for OPC-UA in CLI, match with test and requirements
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3533
diff changeset
    24
    - uses: actions/checkout@v3
0af7b6a96c53 CLI: fix fake_wx for OPC-UA in CLI, match with test and requirements
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3533
diff changeset
    25
      with:
0af7b6a96c53 CLI: fix fake_wx for OPC-UA in CLI, match with test and requirements
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3533
diff changeset
    26
          repository: open62541/open62541
3632
92bfefddae27 Tests: version bump open62541 v1.3.2 -> v1.3.3 for github CI workflow.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3560
diff changeset
    27
          ref: v1.3.3
3549
0af7b6a96c53 CLI: fix fake_wx for OPC-UA in CLI, match with test and requirements
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3533
diff changeset
    28
          path: open62541
3560
f0ed67b01a9d GitHub CI: my bad. m( Was just wrong version
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3559
diff changeset
    29
          submodules: recursive
3549
0af7b6a96c53 CLI: fix fake_wx for OPC-UA in CLI, match with test and requirements
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3533
diff changeset
    30
3459
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    31
    - name: Cache docker image
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    32
      id: cache-docker
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    33
      uses: actions/cache@v3
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    34
      env:
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    35
        cache-name: cache-docker
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    36
      with:
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    37
        path: /tmp/latest.tar
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    38
        key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('beremiz/tests/tools/Docker/beremiz-sikuli') }}
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    39
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    40
    - if: ${{ steps.cache-docker.outputs.cache-hit == false }}
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    41
      name: Create docker image
3456
c0a41c2d0dd1 Create run_tests_in_docker.yml
etisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    42
      run: |
3693
4058140a8757 Tests: cleanup and tidy docker definitions and scripts
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3632
diff changeset
    43
        cd beremiz/tests/tools/Docker
3456
c0a41c2d0dd1 Create run_tests_in_docker.yml
etisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    44
        ./build_docker_image.sh
3460
d3c95ae44750 Tests: fix docker image export for GitHub Action caching.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3459
diff changeset
    45
        docker image save --output="/tmp/latest.tar" beremiz_sikuli
3459
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    46
3464
c8f73bd67817 Tests: ...
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3463
diff changeset
    47
    - if: ${{ steps.cache-docker.outputs.cache-hit != false }}
3459
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    48
      name: Re-use docker image
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    49
      run: |
3460
d3c95ae44750 Tests: fix docker image export for GitHub Action caching.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3459
diff changeset
    50
        docker image load --input="/tmp/latest.tar" 
3459
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    51
3456
c0a41c2d0dd1 Create run_tests_in_docker.yml
etisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    52
    - name: Create docker container
c0a41c2d0dd1 Create run_tests_in_docker.yml
etisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    53
      run: |
3693
4058140a8757 Tests: cleanup and tidy docker definitions and scripts
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3632
diff changeset
    54
        cd beremiz/tests/tools/Docker
3461
fb8c2fa0d8f0 Tests: give test directory when creating container, not when running test.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3460
diff changeset
    55
        ./create_docker_container.sh ${{ github.workspace }}/test
3456
c0a41c2d0dd1 Create run_tests_in_docker.yml
etisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    56
        
3463
f85b448ca2c6 Tests: re-enable running test in github action, now that docker image should be cached.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3462
diff changeset
    57
    - name: Run tests in docker
f85b448ca2c6 Tests: re-enable running test in github action, now that docker image should be cached.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3462
diff changeset
    58
      run: |
3693
4058140a8757 Tests: cleanup and tidy docker definitions and scripts
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3632
diff changeset
    59
        cd beremiz/tests/tools/Docker
3530
ec3672b7532b Github CI: use new name for test launching script
etisserant <edouard.tisserant@gmail.com>
parents: 3465
diff changeset
    60
        ./do_test_in_docker.sh
3459
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    61
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    62
    - name: Upload test resuts artifact
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    63
      uses: actions/upload-artifact@v3
3533
49e7d2247d46 Github CI: upload artifact (reports) when failing
etisserant <edouard.tisserant@gmail.com>
parents: 3530
diff changeset
    64
      if: failure()
3459
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    65
      with:
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    66
        name: test_results
3465
2f5b5c14a650 Tests: No need to archive test results before uploading them as action artifacts.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3464
diff changeset
    67
        path: ${{ github.workspace }}/test
3459
69771a6ca4a6 Tests: More fixes amd enhancments to run tests on Github Actions
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3456
diff changeset
    68
        retention-days: 5