Skip to content

Commit

Permalink
Add nightly build to :CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jaguililla committed Sep 5, 2024
1 parent f3d4709 commit 13b6eff
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

name: Nightly Build
on:
push:
# schedule:
# - cron: "59 23 * * *"

permissions: read-all

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: SDKMAN Cache
uses: actions/cache@v4
with:
path: ~/.sdkman
key: "${{ runner.os }}-sdkman-${{ hashFiles('.sdkmanrc') }}"
restore-keys: "${{ runner.os }}-sdkman-"
- name: Maven Cache
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: "${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}"
restore-keys: "${{ runner.os }}-maven-"
- name: Install SDKMAN
run: curl -s "https://get.sdkman.io?rcupdate=false" | bash
- name: Build Application
run: |
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk env install
./mvnw -P pitest
- name: Build Client
run: |
export CLIENT_PATH='target/generated-sources/openapi'
export CONTROLLERS_PATH='com/github/jaguililla/appointments/http/controllers'
rm -rf "${CLIENT_PATH}/src/main/java/${CONTROLLERS_PATH}"
mvn -f "${CLIENT_PATH}/pom.xml" clean install
18 changes: 18 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,21 @@ release:
release:
tag_name: ${POM_VERSION}
description: Release ${POM_VERSION}

nightly:
stage: build
image: ubuntu:24.04
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
cache:
key: build-cache
paths:
- .m2/repository
before_script:
- apt update
- apt -y install curl zip unzip
- curl -s "https://get.sdkman.io?rcupdate=false" | bash
- source "$HOME/.sdkman/bin/sdkman-init.sh"
script:
- sdk env install
- ./mvnw -P pitest

0 comments on commit 13b6eff

Please sign in to comment.