-
Notifications
You must be signed in to change notification settings - Fork 42
35 lines (34 loc) · 1 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Test Java Problems
on:
pull_request:
types: [labeled]
paths:
- "javaProblems/**"
jobs:
test-java-solutions:
if: ${{ github.event.label.name == 'java-problem-solution' }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "temurin"
architecture: x64
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v39
- name: Test Solutions
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
if [[ "$file" == javaProblems/* && "$file" == *.java ]]; then
folderName=$(awk -F/ '{print $2}' <<< "$file")
echo "Running Tests for $folderName"
cd "javaProblems/$folderName"
javac Test.java
java Test
cd ../..
fi
done