Skip to content

Merge pull request #168 from COS301-SE-2023/dev #54

Merge pull request #168 from COS301-SE-2023/dev

Merge pull request #168 from COS301-SE-2023/dev #54

Workflow file for this run

name: KOJA CI/CD
on:
push:
branches:
- main
pull_request:
branches:
- dev
jobs:
build_and_test_flutter:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Create .env
run: |
echo KOJA_AWS_RDS_DATABASE_URL=${{ secrets.KOJA_AWS_RDS_DATABASE_URL }} >> client/assets/.env
echo KOJA_AWS_RDS_DATABASE_ADMIN_USERNAME=${{ secrets.KOJA_AWS_RDS_DATABASE_ADMIN_USERNAME }} >> client/assets/.env
echo KOJA_AWS_RDS_DATABASE_ADMIN_PASSWORD=${{ secrets.KOJA_AWS_RDS_DATABASE_ADMIN_PASSWORD }} >> client/assets/.env
echo KOJA_AWS_DYNAMODB_ACCESS_KEY_ID=${{ secrets.KOJA_AWS_DYNAMODB_ACCESS_KEY_ID }} >> client/assets/.env
echo KOJA_AWS_DYNAMODB_ACCESS_KEY_SECRET=${{ secrets.KOJA_AWS_DYNAMODB_ACCESS_KEY_SECRET }} >> client/assets/.env
echo GOOGLE_CLIENT_ID=${{ secrets.GOOGLE_CLIENT_ID }} >> client/assets/.env
echo GOOGLE_CLIENT_SECRET=${{ secrets.GOOGLE_CLIENT_SECRET }} >> client/assets/.env
echo KOJA_JWT_SECRET=${{ secrets.KOJA_JWT_SECRET }} >> client/assets/.env
echo API_KEY=${{ secrets.API_KEY }} >> client/assets/.env
echo OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} >> client/assets/.env
echo KOJA_ID_SECRET=${{ secrets.KOJA_ID_SECRET }} >> client/assets/.env
echo COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }} >> client/assets/.env
echo KOJA_PRIVATE_KEY_PASS=${{ secrets.KOJA_PRIVATE_KEY_PASS }} >> client/assets/.env
echo KOJA_PRIVATE_KEY_SALT=${{ secrets.KOJA_PRIVATE_KEY_SALT }} >> client/assets/.env
echo AI_PRIVATE_KEY_PASS=${{ secrets.AI_PRIVATE_KEY_PASS }} >> client/assets/.env
echo AI_PRIVATE_KEY_SALT=${{ secrets.AI_PRIVATE_KEY_SALT }} >> client/assets/.env
echo SERVER_ADDRESS=${{ secrets.SERVER_ADDRESS }} >> client/assets/.env
echo SERVER_PORT=${{ secrets.SERVER_PORT }} >> client/assets/.env
- name: Set up Flutter
uses: subosito/flutter-action@v1
with:
flutter-version: '3.10'
- name: Install Flutter dependencies
run: flutter pub get
working-directory: client
- name: Run Flutter linter
run: flutter analyze
working-directory: client
- name: Run Flutter Tests
run: flutter test
working-directory: client
- name: Build Flutter app
run: flutter build apk
working-directory: client
build_and_test_springboot:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 17
- name: Create .env
run: |
echo KOJA_AWS_RDS_DATABASE_URL=${{ secrets.KOJA_AWS_RDS_DATABASE_URL }} >> .env
echo KOJA_AWS_RDS_DATABASE_ADMIN_USERNAME=${{ secrets.KOJA_AWS_RDS_DATABASE_ADMIN_USERNAME }} >> .env
echo KOJA_AWS_RDS_DATABASE_ADMIN_PASSWORD=${{ secrets.KOJA_AWS_RDS_DATABASE_ADMIN_PASSWORD }} >> .env
echo KOJA_AWS_DYNAMODB_ACCESS_KEY_ID=${{ secrets.KOJA_AWS_DYNAMODB_ACCESS_KEY_ID }} >> .env
echo KOJA_AWS_DYNAMODB_ACCESS_KEY_SECRET=${{ secrets.KOJA_AWS_DYNAMODB_ACCESS_KEY_SECRET }} >> .env
echo GOOGLE_CLIENT_ID=${{ secrets.GOOGLE_CLIENT_ID }} >> .env
echo GOOGLE_CLIENT_SECRET=${{ secrets.GOOGLE_CLIENT_SECRET }} >> .env
echo KOJA_JWT_SECRET=${{ secrets.KOJA_JWT_SECRET }} >> .env
echo API_KEY=${{ secrets.API_KEY }} >> .env
echo OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} >> .env
echo KOJA_ID_SECRET=${{ secrets.KOJA_ID_SECRET }} >> .env
echo COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }} >> .env
echo KOJA_PRIVATE_KEY_PASS=${{ secrets.KOJA_PRIVATE_KEY_PASS }} >> .env
echo KOJA_PRIVATE_KEY_SALT=${{ secrets.KOJA_PRIVATE_KEY_SALT }} >> .env
echo AI_PRIVATE_KEY_PASS=${{ secrets.AI_PRIVATE_KEY_PASS }} >> .env
echo AI_PRIVATE_KEY_SALT=${{ secrets.AI_PRIVATE_KEY_SALT }} >> .env
echo SERVER_ADDRESS=${{ secrets.SERVER_ADDRESS }} >> .env
echo SERVER_PORT=${{ secrets.SERVER_PORT }} >> .env
- name: Run Linter
run: ./gradlew ktlintCheck
- name: Run Tests
run: ./gradlew test
- name: Build Spring Boot project
run: ./gradlew build -x test -x check