Skip to content

Unit Testing

Unit Testing #3

Workflow file for this run

name: Java Unit Testing
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
# Step 1: Check out the repository
- name: Checkout repository
uses: actions/checkout@v3
# Step 2: Set up JDK
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin' # You can change this to your desired distribution (e.g., 'zulu', 'adopt')
# Step 3: Cache Maven dependencies
- name: Cache Maven dependencies
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('MavenBack/**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2
working-directory: MavenBack
# Step 4: Build and test with Maven
- name: Build and run tests
with:
working-directory: MavenBack
run: mvn clean test

Check failure on line 41 in .github/workflows/unit_tests.yml

View workflow run for this annotation

GitHub Actions / Java Unit Testing

Invalid workflow file

The workflow is not valid. .github/workflows/unit_tests.yml (Line: 41, Col: 9): Unexpected value 'run' .github/workflows/unit_tests.yml (Line: 38, Col: 9): Required property is missing: uses