1818 - ' release/**'
1919 paths-ignore :
2020 - ' **/*.md' # Ignore changes to all .md files
21+ schedule :
22+ - cron : ' 0 6 * * 1'
23+ workflow_dispatch :
2124
2225env :
2326 CACHE_NAME_PREFIX : v1
@@ -88,48 +91,53 @@ jobs:
8891 env :
8992 DOCKER_BUILDKIT : 1
9093 TEST_ENV : " true"
91- run : docker compose -f label_studio_ml/examples/${{ matrix.backend_dir_name }}/docker-compose.yml up -d --build
94+ run : docker compose -f label_studio_ml/examples/${{ matrix.backend_dir_name }}/docker-compose.yml up ${{ matrix.skip_pytests != 'true' && '' || '-d' }} --build
9295
9396 - name : Wait for stack
97+ if : ${{ matrix.skip_pytests != 'true' }}
9498 timeout-minutes : 20
9599 run : |
96100 while [ "$(curl -s -o /dev/null -L -w ''%{http_code}'' "http://localhost:9090/health")" != "200" ]; do
97101 echo "=> Waiting for service to become available" && sleep 2s
98102 done
99103
100104 - name : Run general functional tests
105+ if : ${{ matrix.skip_pytests != 'true' }}
101106 env :
102107 ML_BACKEND : ${{ matrix.backend_dir_name }}
103108 run : |
104109 pytest tests/ -vvv --ignore-glob='**/logs/*' --ignore-glob='**/data/*' --cov=. --cov-report=xml:tests/${{ matrix.backend_dir_name }}_coverage.xml
105110
106111 - name : Run per-ml-backend tests
112+ if : ${{ matrix.skip_pytests != 'true' }}
107113 env :
108114 ML_BACKEND : ${{ matrix.backend_dir_name }}
109115 run : |
110116 docker compose -f label_studio_ml/examples/${{ matrix.backend_dir_name }}/docker-compose.yml exec -T ${{ matrix.backend_dir_name }} pytest -vvv --cov --cov-report=xml:/tmp/coverage.xml
111117
112118 - name : Copy per-ml-backend coverage.xml from the container
119+ if : ${{ matrix.skip_pytests != 'true' }}
113120 run : |
114121 docker compose -f label_studio_ml/examples/${{ matrix.backend_dir_name }}/docker-compose.yml cp ${{ matrix.backend_dir_name }}:/tmp/coverage.xml label_studio_ml/examples/${{ matrix.backend_dir_name }}/coverage.xml
115122
116123 - name : Pull the logs
117- if : always()
124+ if : always() && matrix.skip_pytests != 'true'
118125 env :
119126 DOCKER_BUILDKIT : 1
120127 run : docker compose -f label_studio_ml/examples/${{ matrix.backend_dir_name }}/docker-compose.yml logs
121128
122129 - name : " Upload general coverage to Codecov"
123130 if : ${{ matrix.backend_dir_name == 'the_simplest_backend' }}
124- uses : codecov/codecov-action@v4.6.0
131+ uses : codecov/codecov-action@v5.3.1
125132 with :
126133 name : codecov-general
127134 files : ./tests/${{ matrix.backend_dir_name }}_coverage.xml
128135 token : ${{ secrets.CODECOV_TOKEN }}
129136 fail_ci_if_error : false
130137
131138 - name : " Upload ml-backend ${{ matrix.backend_dir_name }} coverage to Codecov"
132- 139+ if : ${{ matrix.backend_dir_name == 'the_simplest_backend' }}
140+ 133141 with :
134142 name : codecov-${{ matrix.backend_dir_name }}
135143 files : ./label_studio_ml/examples/${{ matrix.backend_dir_name }}/coverage.xml
@@ -151,7 +159,7 @@ jobs:
151159 uses : actions/github-script@v7
152160 env :
153161 BASE_REF : " ${{ github.event.pull_request.base.sha || github.event.before }}"
154- HEAD_REF : " ${{ github.event.pull_request.head.sha || github.event.after }}"
162+ HEAD_REF : " ${{ github.event.pull_request.head.sha || github.event.after || github.sha }}"
155163 EVENT_NAME : " ${{ github.event_name }}"
156164 with :
157165 script : |
@@ -176,7 +184,7 @@ jobs:
176184 const docker_build_config = yaml.load(docker_build_config_content);
177185
178186 let backends = [];
179- if (event_name === 'push' ) {
187+ if (event_name === 'schedule' || event_name === 'workflow_dispatch' ) {
180188 const {data: examples} = await github.rest.repos.getContent({
181189 owner: owner,
182190 repo: repo,
@@ -198,19 +206,21 @@ jobs:
198206 for (const backend of backends) {
199207 const config = docker_build_config.find(e => e.backend_dir_name === backend)
200208 let runs_on = "ubuntu-latest";
209+ let skip_pytests = "false";
201210 if (config) {
202211 console.log(`Config for ${backend}:`);
203212 console.log(config);
204213 if ((config.bypass ?? []).includes("pytests")) {
205214 console.log(`Skipping pytests for ${backend}`);
206- continue ;
215+ skip_pytests = "true" ;
207216 }
208217 runs_on = config.runs_on ?? "ubuntu-latest";
209218 } else {
210219 console.log(`Could not find config for ${backend}`);
211220 }
212- matrixInclude.push({"backend_dir_name": backend, "runs_on": runs_on});
221+ matrixInclude.push({"backend_dir_name": backend, "runs_on": runs_on, "skip_pytests": skip_pytests });
213222 }
223+ console.log(`Matrix calculation result:`);
214224 console.log(matrixInclude);
215225 core.setOutput("matrix-include", matrixInclude);
216226
0 commit comments