Skip to content

trying

trying #169

Workflow file for this run

# This workflow will run the tests on the kotlin version of tictactoe
name: kotlin
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./tictactoe_kotlin
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'oracle' # See 'Supported distributions' for available options
java-version: '20'
cache: 'gradle'
- name: Make gradle executable
run: chmod +x ./gradlew
# Execute gradle build command with stacktrace flag
- name: Build with gradle
run: ./gradlew build --stacktrace # Execute gradle script to build project
# Execute gradle script to perform lint check
- name: Lint check
run: ./gradlew lint
- name: Generate lint report
uses: actions/upload-artifact@v4
with: # Define extra parameters
name: lint_report.html # Name of the artifact to be uploaded
path: tictactoe_kotlin/app/build/reports/ # Specifies the path where the artifact to be uploaded is located
# Execute gradle script to execute unit tests
- name: Execute unit tests
run: ./gradlew test --stacktrace
# Generates tests reports as an artifact
- name: Generate test report
uses: actions/upload-artifact@v4
with:
name: unit_tests_report.html
path: tictactoe_kotlin/app/build/reports/tests/testDebugUnitTest/
connected-tests:
runs-on: macos-latest
defaults:
run:
working-directory: ./tictactoe_kotlin
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 20
uses: actions/setup-java@v4
with:
java-version: 20
distribution: 'oracle'
cache: 'gradle'
- name: Make gradle executable
run: chmod +x ./gradlew
- name: Run connected tests
uses: ReactiveCircus/android-emulator-runner@v2
with:
api-level: 29
target: default
arch: x86_64
working-directory: ./tictactoe_kotlin
script: ./gradlew connectedCheck
# Generates tests reports as an artifact
- name: Generate test report
uses: actions/upload-artifact@v4
with:
name: android_tests_report.html
path: tictactoe_kotlin/app/build/reports/androidTests/connected