chore(CI): create workflow for assembling and testing #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: (CI) - Building and testing the project | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main, CHR8486 ] | |
pull_request: | |
types: [ opened, synchronize, reopened, closed, edited ] | |
branches: [ main, CHR8486 ] | |
jobs: | |
assemble: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_LOGIN: ${{ github.actor }} | |
GITHUB_PACKAGES: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: This step creates a copy of the repository for the workflow to run on | |
uses: actions/checkout@v3 | |
- name: This step sets up java on the machine running this workflow | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '16' | |
- name: Assembling the gradle project | |
run: | | |
chmod +x gradlew | |
./gradlew assemble | |
test: | |
runs-on: ubuntu-latest | |
needs: assemble | |
env: | |
GITHUB_LOGIN: ${{ github.actor }} | |
GITHUB_PACKAGES: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: This step creates a copy of the repository for the workflow to run on | |
uses: actions/checkout@v3 | |
- name: This step sets up java on the machine running this workflow | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '16' | |
- name: Testing the gradle project. | |
run: | | |
chmod +x gradlew | |
./gradlew test |