Skip to content

Commit 2e82f4d

Browse files
authored
Add a note describing the GitLab CI setup (#4791)
1 parent d816fd1 commit 2e82f4d

File tree

4 files changed

+54
-0
lines changed

4 files changed

+54
-0
lines changed

.gitlab/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
This note describes the setup of our GitHub/GitLab integration. The main
2+
AMReX repo is hosted at https://github.com/AMReX-Codes/amrex, with a mirror
3+
at https://gitlab.spack.io/amrex/amrex. The GitLab mirror runs CI tests on
4+
runners hosted at
5+
https://systems.nic.uoregon.edu/internal-wiki/index.php?title=Category:Servers. We
6+
run three types of tests: nightly tests using the development branch, tests
7+
triggerd when new commits are pushed to the GitLab mirror (either through
8+
GitLab's regular pulling of the latest development branch from GitHub or by
9+
the developers directly), and tests triggered by a special comment from
10+
maintainers.
11+
12+
Instructions for creating a pull mirror can be found at
13+
https://docs.gitlab.com/user/project/repository/mirror/pull/. You can choose
14+
to pull selected branches or all branches. For AMReX, this choice does not
15+
matter since we only have one active branch. However, for repoositories with
16+
many active branches, pulling all branches may trigger CI jobs on every
17+
activity.
18+
19+
Instructions for creating schedules pipelines can be found at
20+
https://docs.gitlab.com/ci/pipelines/schedules/. By default, GitLab uses
21+
`.gitlab-ci.yml` at the repository root for pipeline configurations, but
22+
this can be changed. AMReX's GitLab CI file is in the `.gitlab`
23+
directory. To change the configuration file location, select `Settings ->
24+
CI/CD -> General pipelines` and update `CI/CD configuration file`.
25+
26+
CI/CD jobs triggered by push require no special setup. They can also be
27+
disabled.
28+
29+
For GitHub PR triggered jobs, we choose not to run automatically. Instead
30+
they need to be triggered by a `/run-hpsf-gitlab-ci` comment from authorized
31+
maintainers, which starts the `run-hpsf-gitlab-ci` workflow defined in
32+
`.github/workflows/trigger-hpsf-gitlab-ci.yml`. This workflow uses GitLab's
33+
REST API to start a pipeline job on GitLab. The PR comment triggered
34+
pipeline job uses the same configuration file shared with the scheduled
35+
pipeline: `.gitlab/hpsf-gitlab-ci.yml`. The PR comment triggered job pulls
36+
the PR branch from GitHub first before running tests. For this approach to
37+
work, we store a pipeline trigger (obtained from GitLab's `Settings -> CI/CD
38+
-> Pipeline trigger tokens`) as a secret at GitHub's `Settings -> Secrets
39+
and variables -> Actions -> Repository secrets`. The GitHub workflow waits
40+
for the result of the GitLab pipeline result and posts the final status and
41+
a link to the result as a comment.

.gitlab/hpsf-gitlab-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ workflow:
1111
echo "GITHUB_MERGE_REF=$GITHUB_MERGE_REF"
1212
echo "GITHUB_TRIGGER_ACTOR=$GITHUB_TRIGGER_ACTOR"
1313
echo "GITHUB_PR_TITLE=$GITHUB_PR_TITLE"
14+
git remote remove github || true
1415
git remote add github https://github.com/amrex-codes/amrex.git
1516
git fetch --depth=1 github "${GITHUB_MERGE_REF}"
1617
git checkout FETCH_HEAD

Tests/Algebra/GMRES/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
if (AMReX_SYCL)
2+
return()
3+
endif()
4+
15
foreach(D IN LISTS AMReX_SPACEDIM)
26
set(_sources main.cpp)
37
set(_input_files )

Tests/FFT/C2C/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
foreach(D IN LISTS AMReX_SPACEDIM)
2+
if (D EQUAL 2)
3+
return()
4+
endif()
5+
6+
if (D EQUAL 3)
7+
return()
8+
endif()
9+
210
set(_sources main.cpp)
311

412
set(_input_files)

0 commit comments

Comments
 (0)