Skip to content

Commit 0bfbf0c

Browse files
committed
Add a pre-commit stage in the Gitlab CI
1 parent fe5674b commit 0bfbf0c

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.gitlab-ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,52 @@
1+
include:
2+
- component: $CI_SERVER_FQDN/eng/gitlab-templates/check-issue@~latest
3+
inputs:
4+
stage: checkstyle
5+
- component: $CI_SERVER_FQDN/eng/gitlab-templates/pre-commit@~latest
6+
inputs:
7+
stage: checkstyle
8+
19
stages:
10+
- checkstyle
211
- test
312

13+
pre-commit:
14+
services:
15+
- image:pe-base
16+
- cpu:8
17+
- mem:32
18+
- disk:50
19+
before_script:
20+
# Create a sandbox and install needed dependencies
21+
- generic_anod_ci
22+
- . /tmp/ci_env.sh
23+
# Define working variables
24+
- npm_cache=$PWD/npm_cache
25+
- npm_cache_install=$npm_cache/spotless-prettier-node-modules-fbb3f0657a1374078dbfdc0a3df68734
26+
- maven_local_repo=$(anod info maven-repo-pull -Qclient=lkql --show working_dir)/install
27+
- npmrc_file=$PWD/.npmrc
28+
29+
# Echo vars to log information about the run
30+
- echo $npm_cache
31+
- echo $npm_cache_install
32+
- echo $maven_local_repo
33+
34+
# Install all pre-commit dependencies
35+
- anod install gnatformat
36+
- anod build java -Q version=17,vendor=graalvm
37+
- anod build maven -Q version=3.6.3
38+
- anod build nodejs -Q version=16.19.1
39+
- anod build maven-repo-pull -Q client=lkql
40+
- eval $(anod printenv gnatformat)
41+
- eval $(anod printenv java -Q version=17,vendor=graalvm)
42+
- eval $(anod printenv maven -Q version=3.6.3)
43+
- eval $(anod printenv nodejs -Q version=16.19.1)
44+
- mkdir -p $npm_cache_install
45+
- e3-cathod thirdparty prettier_java-npm_cache-20250203.tar.gz --install $npm_cache_install --delete
46+
- ls $npm_cache_install
47+
- echo "offline=true" > $npmrc_file
48+
- export MAVEN_ARGS="-Dmaven.repo.local=$maven_local_repo -Dconfig.npmInstallCache=$npm_cache -Dconfig.npmrc=$npmrc_file"
49+
450
# Common part for all testing CIs
551
.common-test-part: &common-test-part
652
services:

0 commit comments

Comments
 (0)