Repository navigation
76 lines (70 loc) · 2.84 KB
/
Copy pathgitlab-ci.yml
File metadata and controls
76 lines (70 loc) · 2.84 KB
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
# Copyright (c) 2025 ETH Zurich and University of Bologna.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
# Author: Paul Scheffler <paulsc@iis.ee.ethz.ch>
# Mirror to the internal GitLab, where the nonfree sub-pipeline (FPGA tests) runs
name: gitlab-ci
# Pushes to branches are covered by their pull request, so only `main` is checked on push
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
steps:
-
name: Note start time
id: start
# Skip on forks or pull requests from forks due to missing secrets.
if: >
github.repository == 'pulp-platform/croc' &&
(github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository)
run: echo "time=$(date +%s)" >> "$GITHUB_OUTPUT"
-
name: Mirror and check
id: mirror
uses: pulp-platform/pulp-actions/gitlab-ci@v2.4.1
# Skip on forks or pull requests from forks due to missing secrets.
if: >
github.repository == 'pulp-platform/croc' &&
(github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository)
with:
domain: iis-git.ee.ethz.ch
repo: github-mirror/croc
token: ${{ secrets.GITLAB_TOKEN }}
poll-count: 10800 # (10800/60=180min=3hours)
# The Pages report shows this result; the mirror step above already fails the job on a failed check.
# The mirror action leaves a checkout of this commit in the workspace, which provides the script.
-
name: Record check result
if: >
always() &&
github.repository == 'pulp-platform/croc' &&
(github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository)
env:
START_TIME: ${{ steps.start.outputs.time }}
MIRROR_OUTCOME: ${{ steps.mirror.outcome }}
# Pull request runs check out a merge commit, but the check tests the head commit
CROC_CI_SOURCE_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
python3 .github/scripts/record_ci.py result --report fpga --stage fpga \
--outcome "$MIRROR_OUTCOME" --elapsed-seconds "$(( $(date +%s) - START_TIME ))"
-
name: Upload check result
if: >
always() &&
github.repository == 'pulp-platform/croc' &&
(github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository)
uses: actions/upload-artifact@v4
with:
name: croc-report-fpga
overwrite: true
path: ci-results/
if-no-files-found: ignore