|
1 | 1 | stages:
|
2 |
| - - unit-test |
3 |
| - - generate_integration_test |
4 |
| - - run_integration_test |
5 |
| - - verify-unit-test-deps |
| 2 | +- generate |
| 3 | +- run |
6 | 4 |
|
7 |
| -.unit_test_template: |
8 |
| - stage: unit-test |
9 |
| - script: |
10 |
| - - apt update && apt install -y git |
11 |
| - - git clone --depth 1 -b dev https://github.com/QEDjl-project/QuantumElectrodynamics.jl.git /tmp/integration_test_tools/ |
12 |
| - - $(julia --project=. /tmp/integration_test_tools/.ci/integTestGen/src/get_project_name_version_path.jl) |
13 |
| - - echo "CI_DEV_PKG_NAME -> $CI_DEV_PKG_NAME" |
14 |
| - - echo "CI_DEV_PKG_VERSION -> $CI_DEV_PKG_VERSION" |
15 |
| - - echo "CI_DEV_PKG_PATH -> $CI_DEV_PKG_PATH" |
16 |
| - - > |
17 |
| - if [[ $CI_COMMIT_BRANCH == "main" || $CI_COMMIT_REF_NAME == "main" || $CI_COMMIT_BRANCH == "dev" || $CI_COMMIT_REF_NAME == "dev" ]]; then |
18 |
| - # set name of the commit message from CI_COMMIT_MESSAGE to NO_MESSAGE, that the script does not read accidentally custom packages from the commit message of a merge commit |
19 |
| - julia --project=. /tmp/integration_test_tools/.ci/SetupDevEnv/src/SetupDevEnv.jl ${CI_PROJECT_DIR}/Project.toml NO_MESSAGE |
20 |
| - else |
21 |
| - julia --project=. /tmp/integration_test_tools/.ci/SetupDevEnv/src/SetupDevEnv.jl ${CI_PROJECT_DIR}/Project.toml |
22 |
| - fi |
23 |
| - - julia --project=. -e 'import Pkg; Pkg.instantiate()' |
24 |
| - - julia --project=. -e 'import Pkg; Pkg.test(; coverage = true)' |
25 |
| - interruptible: true |
26 |
| - tags: |
27 |
| - - cpuonly |
28 |
| - |
29 |
| -unit_tests_releases: |
30 |
| - extends: .unit_test_template |
31 |
| - parallel: |
32 |
| - matrix: |
33 |
| - - JULIA_VERSION: ["1.10", "1.11", "rc"] |
34 |
| - image: julia:$JULIA_VERSION |
35 |
| - |
36 |
| -unit_tests_nightly: |
37 |
| - extends: .unit_test_template |
38 |
| - # use the same baseimage like the official julia images |
39 |
| - image: debian:bookworm-slim |
40 |
| - variables: |
41 |
| - # path where julia tar bal should be downloaded |
42 |
| - JULIA_DOWNLOAD: /julia/download |
43 |
| - # path where julia should be extracted |
44 |
| - JULIA_EXTRACT: /julia/extract |
45 |
| - before_script: |
46 |
| - - apt update && apt install -y wget |
47 |
| - - mkdir -p $JULIA_DOWNLOAD |
48 |
| - - mkdir -p $JULIA_EXTRACT |
49 |
| - - > |
50 |
| - if [[ $CI_RUNNER_EXECUTABLE_ARCH == "linux/arm64" ]]; then |
51 |
| - wget https://julialangnightlies-s3.julialang.org/bin/linux/aarch64/julia-latest-linux-aarch64.tar.gz -O $JULIA_DOWNLOAD/julia-nightly.tar.gz |
52 |
| - elif [[ $CI_RUNNER_EXECUTABLE_ARCH == "linux/amd64" ]]; then |
53 |
| - wget https://julialangnightlies-s3.julialang.org/bin/linux/x86_64/julia-latest-linux-x86_64.tar.gz -O $JULIA_DOWNLOAD/julia-nightly.tar.gz |
54 |
| - else |
55 |
| - echo "unknown runner architecture -> $CI_RUNNER_EXECUTABLE_ARCH" |
56 |
| - exit 1 |
57 |
| - fi |
58 |
| - - tar -xf $JULIA_DOWNLOAD/julia-nightly.tar.gz -C $JULIA_EXTRACT |
59 |
| - # we need to search for the julia base folder name, because the second part of the name is the git commit hash |
60 |
| - # e.g. julia-b0c6781676f |
61 |
| - - JULIA_EXTRACT_FOLDER=${JULIA_EXTRACT}/$(ls $JULIA_EXTRACT | grep -m1 julia) |
62 |
| - # copy everything to /usr to make julia public available |
63 |
| - # mv is not possible, because it cannot merge folder |
64 |
| - - cp -r $JULIA_EXTRACT_FOLDER/* /usr |
65 |
| - allow_failure: true |
66 |
| - tags: |
67 |
| - - cpuonly |
68 |
| - |
69 |
| -generate_integration_tests: |
| 5 | +generate_pipeline: |
70 | 6 | image: julia:1.10
|
71 |
| - stage: generate_integration_test |
| 7 | + stage: generate |
| 8 | + variables: |
| 9 | + CI_GIT_CI_TOOLS_URL: https://github.com/QEDjl-project/QuantumElectrodynamics.jl.git |
| 10 | + CI_GIT_CI_TOOLS_BRANCH: dev |
72 | 11 | script:
|
73 |
| - # extract package name |
74 | 12 | - apt update && apt install -y git
|
75 |
| - - git clone --depth 1 -b dev https://github.com/QEDjl-project/QuantumElectrodynamics.jl.git /QEDjl |
76 |
| - - $(julia --project /QEDjl/.ci/integTestGen/src/get_project_name_version_path.jl) |
77 |
| - - echo "CI_DEV_PKG_NAME -> $CI_DEV_PKG_NAME" |
78 |
| - - echo "CI_DEV_PKG_VERSION -> $CI_DEV_PKG_VERSION" |
79 |
| - - echo "CI_DEV_PKG_PATH -> $CI_DEV_PKG_PATH" |
80 |
| - - cd /QEDjl/.ci/integTestGen/ |
81 |
| - - julia --project=. -e 'import Pkg; Pkg.instantiate()' |
82 |
| - # paths of artifacts are relative to CI_PROJECT_DIR |
83 |
| - - > |
84 |
| - if [[ $CI_COMMIT_BRANCH == "main" || $CI_COMMIT_REF_NAME == "main" || $CI_COMMIT_BRANCH == "dev" || $CI_COMMIT_REF_NAME == "dev" ]]; then |
85 |
| - # set name of the commit message from CI_COMMIT_MESSAGE to NO_MESSAGE, that the script does not read accidentally custom packages from the commit message of a merge commit |
86 |
| - julia --project=. src/integTestGen.jl NO_MESSAGE > $CI_PROJECT_DIR/integrationjobs.yaml |
87 |
| - else |
88 |
| - julia --project=. src/integTestGen.jl > $CI_PROJECT_DIR/integrationjobs.yaml |
89 |
| - fi |
90 |
| - - cat $CI_PROJECT_DIR/integrationjobs.yaml |
| 13 | + - git clone --depth 1 -b $CI_GIT_CI_TOOLS_BRANCH $CI_GIT_CI_TOOLS_URL /generator |
| 14 | + - julia --project=/generator/.ci/CI -e 'import Pkg; Pkg.instantiate()' |
| 15 | + - julia --project=/generator/.ci/CI /generator/.ci/CI/src/Bootloader.jl > $CI_PROJECT_DIR/pipeline.yaml |
| 16 | + - cat $CI_PROJECT_DIR/pipeline.yaml |
91 | 17 | artifacts:
|
92 | 18 | paths:
|
93 |
| - - integrationjobs.yaml |
| 19 | + - pipeline.yaml |
94 | 20 | expire_in: 1 week
|
95 | 21 | interruptible: true
|
96 | 22 | tags:
|
97 | 23 | - cpuonly
|
98 | 24 |
|
99 |
| -run_integration_tests: |
100 |
| - stage: run_integration_test |
| 25 | +run_pipeline: |
| 26 | + stage: run |
101 | 27 | trigger:
|
102 | 28 | include:
|
103 |
| - - artifact: integrationjobs.yaml |
104 |
| - job: generate_integration_tests |
| 29 | + - artifact: pipeline.yaml |
| 30 | + job: generate_pipeline |
105 | 31 | strategy: depend
|
106 |
| - |
107 |
| -verify-unit-test-deps_julia1.10: |
108 |
| - image: julia:1.10 |
109 |
| - stage: verify-unit-test-deps |
110 |
| - script: |
111 |
| - - apt update && apt install -y git |
112 |
| - - git clone --depth 1 -b dev https://github.com/QEDjl-project/QuantumElectrodynamics.jl.git /QEDjl |
113 |
| - - > |
114 |
| - if [[ $CI_COMMIT_BRANCH == "main" || $CI_COMMIT_REF_NAME == "main" || $CI_COMMIT_BRANCH == "dev" || $CI_COMMIT_REF_NAME == "dev" ]]; then |
115 |
| - # does not check for custom package URLs on the main and dev branch |
116 |
| - echo "no custom package URL check necessary" |
117 |
| - else |
118 |
| - julia /QEDjl/.ci/verify_env.jl |
119 |
| - fi |
120 |
| - interruptible: true |
121 |
| - tags: |
122 |
| - - cpuonly |
0 commit comments