diff --git a/.github/workflows/check-tests.yml b/.github/workflows/check-tests.yml new file mode 100644 index 0000000..d6e31a8 --- /dev/null +++ b/.github/workflows/check-tests.yml @@ -0,0 +1,41 @@ +name: Run Kotlin Check Tests +on: + push: + branches: [ "main", "development" ] +# pull_request: +# branches: [ "main", "development" ] + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Java (for Kotlin) + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + - name: Install Latest Kotlin Compiler + run: | + curl -s https://get.sdkman.io | bash + source "$HOME/.sdkman/bin/sdkman-init.sh" + sdk install kotlin + - name: Compile Kotlin files + run: | + mkdir -p out/classes + find src -name "*.kt" > sources.txt + kotlinc @sources.txt -include-runtime -d out/classes + - name: Create Manifest File + run: | + echo "Manifest-Version: 1.0" > MANIFEST.MF + echo "Main-Class: MainKt" >> MANIFEST.MF + - name: Package Executable JAR + run: | + jar cfm out/TestRunner.jar MANIFEST.MF -C out/classes . + - name: Run Tests and Fail on "Failed" + run: | + set -o pipefail + OUTPUT=$(kotlin out/TestRunner.jar | tee output.log) + echo "$OUTPUT" + echo "$OUTPUT" | grep -q "Failed" && exit 1 || echo "All tests passed" \ No newline at end of file diff --git a/.idea/artifacts/Finance_Tracker_jar.xml b/.idea/artifacts/Finance_Tracker_jar.xml new file mode 100644 index 0000000..95947c8 --- /dev/null +++ b/.idea/artifacts/Finance_Tracker_jar.xml @@ -0,0 +1,10 @@ + + + $PROJECT_DIR$/out/artifacts/Finance_Tracker_jar + + + + + + + \ No newline at end of file diff --git a/src/META-INF/MANIFEST.MF b/src/META-INF/MANIFEST.MF new file mode 100644 index 0000000..82c7964 --- /dev/null +++ b/src/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: MainKt +