Skip to content

Commit e967f0c

Browse files
committed
Fix CI
1 parent 2b00865 commit e967f0c

3 files changed

Lines changed: 4 additions & 68 deletions

File tree

.github/workflows/master.yml

Lines changed: 1 addition & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ jobs:
236236
working-directory: ./apps/codebattle
237237

238238
build_images:
239-
needs: [changes]
239+
needs: [changes, backend_tests, elixir_quality, frontend_quality]
240240
if: |
241241
github.repository == 'hexlet-codebattle/codebattle' &&
242242
(needs.changes.outputs.codebattle_image == 'true' || needs.changes.outputs.runner_image == 'true')
@@ -268,72 +268,6 @@ jobs:
268268
run: |
269269
make BUILDX_OUTPUT=--load GIT_HASH=${{ github.sha }} build-runner
270270
271-
- name: Wait for required checks
272-
uses: actions/github-script@v7
273-
with:
274-
script: |
275-
const required = ["backend_tests", "elixir_quality", "frontend_quality"];
276-
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
277-
const deadline = Date.now() + 45 * 60 * 1000;
278-
279-
while (true) {
280-
const jobs = await github.paginate(
281-
github.rest.actions.listJobsForWorkflowRun,
282-
{
283-
owner: context.repo.owner,
284-
repo: context.repo.repo,
285-
run_id: context.runId,
286-
per_page: 100,
287-
},
288-
response => response.data.jobs,
289-
);
290-
291-
const safeRuns = (jobs || []).filter(run => run && typeof run.name === "string");
292-
const byName = new Map();
293-
for (const run of safeRuns) {
294-
const existing = byName.get(run.name);
295-
if (!existing || (run.id ?? 0) > (existing.id ?? 0)) {
296-
byName.set(run.name, run);
297-
}
298-
}
299-
const pending = [];
300-
const failed = [];
301-
302-
for (const name of required) {
303-
const run = byName.get(name);
304-
305-
if (!run || run.status !== "completed") {
306-
pending.push(name);
307-
continue;
308-
}
309-
310-
if (run.conclusion !== "success") {
311-
failed.push(`${name}:${run.conclusion}`);
312-
}
313-
}
314-
315-
core.info(
316-
`jobs_total=${(jobs || []).length}, jobs_named=${safeRuns.length}, pending=[${pending.join(", ")}], failed=[${failed.join(", ")}]`,
317-
);
318-
319-
if (failed.length > 0) {
320-
core.setFailed(`Required checks failed: ${failed.join(", ")}`);
321-
return;
322-
}
323-
324-
if (pending.length === 0) {
325-
core.info("All required checks passed. Continue to push.");
326-
return;
327-
}
328-
329-
if (Date.now() > deadline) {
330-
core.setFailed(`Timed out waiting for required checks: ${pending.join(", ")}`);
331-
return;
332-
}
333-
334-
await sleep(20_000);
335-
}
336-
337271
- name: Login to Github Container Registry (before push)
338272
uses: docker/login-action@v3
339273
with:

apps/codebattle/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@
175175
"proxy": "http://localhost:8080",
176176
"pnpm": {
177177
"overrides": {
178+
"glob@7.2.3>minimatch": "^9.0.5",
178179
"js-yaml": "^4.1.1",
179180
"lodash-es": "^4.17.22",
180181
"qs": "^6.14.2"

apps/codebattle/pnpm-lock.yaml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)