We can use GitHub to check every change running our tests.
Create a folder in the root of the project .github/workflows/ (pay attention to the dot in github folder )
Create a build.yaml file (name doesn’t matter only the extension)
name: build
on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:
branches:
- '*'
jobs:
build:
name: Build
if: "!contains(github.event.head_commit.message, '[ci skip]')"
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
java_version: [17]
steps:
- name: Environment
run: env | sort
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 1
submodules: true
- name: Setup Java ${{ matrix.java_version }}
uses: actions/setup-java@v1
with:
java-version: ${{matrix.java_version}}
architecture: x64
- name: Compile
run: ./gradlew assemble
- name: Tests
run: ./gradlew check
env:
GRADLE_OPTS: '-Dorg.gradle.daemon=false'
Once merged this file, GitHub will run a ./gradlew assemble check in every commit, in all branches, all PR, etc
If some test fails, we’ll receive a notification.