File size: 2,151 Bytes
db5855f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Build Docker image and test notebooks in Docker image
# Test script location: .docker/.s2i/bin/test

name: docker_treon

on:
  workflow_dispatch:
  schedule:
    - cron: '30 3 * * *'
  push:
    branches:
      - 'main'
      - 'latest'
    paths:
      - 'Dockerfile'
      - '.docker/**'
      - '.github/workflows/*.yml'
      - '.github/workflows/.env'
      - 'notebooks/**.ipynb'
      - 'notebooks/**.py'
      - 'requirements.txt'
      - '.ci/*requirements.txt'
  pull_request:
    branches:
      - 'main'
      - 'latest'
    paths:
      - 'Dockerfile'
      - '.docker/**'
      - '.github/workflows/*.yml'
      - '.github/workflows/.env'
      - 'notebooks/**.ipynb'
      - 'notebooks/**.py'

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

jobs:
  build_docker:
    strategy:
      fail-fast: false

    runs-on: ubuntu-20.04

    steps:
      - name: Maximize build space
        run: |
          sudo rm -rf /usr/local/lib/android # will release about 10 GB if you don't need Android
          sudo rm -rf /usr/share/dotnet # will release about 20GB if you don't need .NET
          sudo rm -rf /opt/ghc
          echo "Available storage:"
          df -h
      - uses: actions/checkout@v4
      - name: Get changed files
        id: changed-files
        uses: tj-actions/changed-files@v41
        with:
          files: |
            notebooks/*/**
            requirements.txt

      - name: List all changed files
        run: |
          touch .ci/test_notebooks.txt
          for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
            echo "$file was changed"
            echo $file >> .ci/test_notebooks.txt
          done
        shell: bash
      - name: Build Docker image
        run: |
          docker build . -t openvino_notebooks
      - name: Test notebooks in Docker image
        run: |
          # Test script location: .docker/.s2i/bin/test_precommit
          docker run --entrypoint /tmp/scripts/test_precommit openvino_notebooks