wip #333
Workflow file for this run
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
# This workflow will build a Java project with Maven | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
name: Build | |
on: | |
push: | |
branches: | |
- '**' | |
tags-ignore: | |
- '**' | |
env: | |
IS_NON_FEATURE_BRANCH: ${{ github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release') }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# test against latest update of each major Java version, as well as specific updates of LTS versions: | |
java: [8, 11.0.x, 13 ] | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v2 | |
- name: Cache the maven artifacts | |
uses: actions/cache@v1 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Configure java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: ${{ matrix.java }} | |
- name: Build and run tests | |
run: mvn -B package | |
- run: echo ${{ env.IS_NON_FEATURE_BRANCH }} | |
- name: Run integration tests | |
run: mvn verify | |
if: env.IS_NON_FEATURE_BRANCH == 'true' | |
env: | |
REVAI_ACCESS_TOKEN: ${{ secrets.INTEGRATION_TEST_ACCESS_TOKEN }} | |
- name: Save build artifacts to staging area | |
run: mkdir staging && cp target/*.jar staging | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v1 | |
with: | |
name: Package | |
path: staging | |
- name: Notify slack fail | |
if: failure() && env.IS_NON_FEATURE_BRANCH == 'true' | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
uses: voxmedia/github-action-slack-notify-build@v1 | |
with: | |
channel: revai-alerts-prod | |
status: FAILED | |
color: danger | |
slack_success: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Notify slack success | |
if: success() && env.IS_NON_FEATURE_BRANCH == 'true' | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
uses: voxmedia/github-action-slack-notify-build@v1 | |
with: | |
channel: revai-alerts-prod | |
status: SUCCESS | |
color: good | |