diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..0b689df --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,90 @@ +name: TraceFit CI + +on: + push: + branches: + - develop + pull_request: + +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +jobs: + + GradleBuild: + runs-on: macos-13 + outputs: + status: ${{ steps.status.outputs.status }} + steps: + + - name: Clone Repo + uses: actions/checkout@v4.1.1 + with: + submodules: 'recursive' + fetch-depth: 0 + + - name: Set up JDK 17 + uses: actions/setup-java@v3.13.0 + with: + java-version: 17 + distribution: 'temurin' + + - name: Assemble + uses: gradle/gradle-build-action@v2.9.0 + with: + arguments: assemble + + - name: Cancel other jobs if this fails + if: failure() + uses: andymckay/cancel-action@0.3 + + - name: Set Job Status + id: status + run: echo "status=success" >> $GITHUB_OUTPUT + + Quality: + runs-on: macos-13 + outputs: + status: ${{ steps.status.outputs.status }} + steps: + + - name: Clone Repo + uses: actions/checkout@v4.1.1 + with: + submodules: 'recursive' + + - name: Set up JDK 17 + uses: actions/setup-java@v3.13.0 + with: + java-version: 17 + distribution: 'temurin' + + - name: Run Quality Jobs + uses: gradle/gradle-build-action@v2.9.0 + with: + arguments: check + + - name: Cancel other jobs if this fails + if: failure() + uses: andymckay/cancel-action@0.3 + + - name: Set Job Status + id: status + run: echo "status=success" >> $GITHUB_OUTPUT + + + Notify: + runs-on: ubuntu-latest + needs: [ GradleBuild, Quality] + if: always() + steps: + + - name: Notify slack fail + if: false == (needs.GradleBuild.outputs.status == 'success') || + false == (needs.Quality.outputs.status == 'success') || + uses: voxmedia/github-action-slack-notify-build@v1.6.0 + with: + channel: ccc-github + status: FAILED + color: danger