Ticket #16857: 16857_0001-Initial-GitLab-CI.patch

File 16857_0001-Initial-GitLab-CI.patch, 2.8 KB (added by taylor.smock, 5 years ago)

Initial GitLab CI. Uses matrix jobs for Java 11, 16, and 17-ea. Java 8 is run by itself so that the report artifacts can be shown (not currently working for pmd/checkstyle/spotbugs).

  • new file .gitlab-ci.yml

    From 5e2bafa40c14f56865c78c762fc20dfd03a4a12d Mon Sep 17 00:00:00 2001
    From: Taylor Smock <tsmock@fb.com>
    Date: Tue, 6 Apr 2021 08:25:42 -0600
    Subject: [PATCH 1/2] Initial GitLab CI
    
    Signed-off-by: Taylor Smock <tsmock@fb.com>
    ---
     .gitlab-ci.yml       | 11 +++++++
     .gitlab/pipeline.yml | 74 ++++++++++++++++++++++++++++++++++++++++++++
     2 files changed, 85 insertions(+)
     create mode 100644 .gitlab-ci.yml
     create mode 100644 .gitlab/pipeline.yml
    
    diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
    new file mode 100644
    index 000000000..80445b9f0
    - +  
     1include:
     2  local: ".gitlab/pipeline.yml"
     3
     4build:
     5  stage: build
     6  trigger:
     7    include: .gitlab/pipeline.yml
     8  parallel:
     9    matrix:
     10      - JAVA_VERSION: [11, 16, 17-ea]
     11      #- ARCHITECTURE: [amd64] # openjdk archs include arm64v8 and windows-amd64. Mac builds would probably have to be separate.
  • new file .gitlab/pipeline.yml

    diff --git a/.gitlab/pipeline.yml b/.gitlab/pipeline.yml
    new file mode 100644
    index 000000000..b9aaa86d8
    - +  
     1variables:
     2  IVY_CACHE_DIR: "$CI_PROJECT_DIR/.cache/ivy"
     3  JAVA_VERSION: 8
     4
     5cache:
     6  paths:
     7    - .cache/
     8    - tools/
     9
     10build-dist:
     11  image: registry.gitlab.com/smocktaylor/josm/openjdk/ant:$JAVA_VERSION
     12  stage: deploy
     13  script:
     14    - $ANT_HOME/bin/ant -Divy.home="$IVY_CACHE_DIR" dist-optimized-report distmac distwin javadoc taginfo
     15  interruptible: true
     16  artifacts:
     17    public: true
     18    paths: ["build/dist/"]
     19
     20
     21build-java:
     22  image: registry.gitlab.com/smocktaylor/josm/openjdk/ant:$JAVA_VERSION
     23  stage: build
     24  script:
     25    - $ANT_HOME/bin/ant -Divy.home="$IVY_CACHE_DIR" clean dist
     26  interruptible: true
     27  artifacts:
     28    paths:
     29      - "build"
     30
     31test-java:
     32  image: registry.gitlab.com/smocktaylor/josm/openjdk/ant:$JAVA_VERSION
     33  stage: test
     34  script:
     35    - $ANT_HOME/bin/ant -Divy.home="$IVY_CACHE_DIR" -Dtest.headless=true test
     36  interruptible: true
     37  artifacts:
     38    public: true
     39    reports:
     40      junit:
     41        - "test/report/TEST-*.xml"
     42
     43pmd-java:
     44  image: registry.gitlab.com/smocktaylor/josm/openjdk/ant:$JAVA_VERSION
     45  stage: test
     46  script:
     47    - $ANT_HOME/bin/ant -Divy.home="$IVY_CACHE_DIR" pmd
     48  interruptible: true
     49  artifacts:
     50    public: true
     51    paths:
     52      - "tools/pmd/cache"
     53
     54checkstyle-java:
     55  image: registry.gitlab.com/smocktaylor/josm/openjdk/ant:$JAVA_VERSION
     56  stage: test
     57  script:
     58    - $ANT_HOME/bin/ant -Divy.home="$IVY_CACHE_DIR" checkstyle
     59  interruptible: true
     60  artifacts:
     61    public: true
     62    paths:
     63      - "checkstyle-josm.xml"
     64
     65spotbugs-java:
     66  image: registry.gitlab.com/smocktaylor/josm/openjdk/ant:$JAVA_VERSION
     67  stage: test
     68  script:
     69    - $ANT_HOME/bin/ant -Divy.home="$IVY_CACHE_DIR" spotbugs
     70  interruptible: true
     71  artifacts:
     72    public: true
     73    paths:
     74      - "spotbugs-josm.xml"