Add CI for development branch #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Development | |
on: | |
push: | |
branches: | |
- "development" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 8 | |
distribution: 'adopt' | |
- name: Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-maven- | |
- name: Run Tests | |
run: mvn $MAVEN_CLI_OPTS -Dtestng.groups="travis-ci" test | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
env: | |
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 8 | |
distribution: 'adopt' | |
- name: Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-maven- | |
- name: Deploy to GitHub packages | |
run: mvn $MAVEN_CLI_OPTS clean deploy -Dmaven.test.skip=true -Pdefault | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
dispatch: | |
needs: [build, deploy] | |
strategy: | |
matrix: | |
repo: [ 'keeps/dbptk-desktop', 'keeps/dbptk-enterprise' ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Repository Dispatch | |
uses: peter-evans/repository-dispatch@v1 | |
with: | |
token: ${{ secrets.REPO_ACCESS_TOKEN }} | |
repository: ${{ matrix.repo }} | |
event-type: dispatch-development |