Visualizza utente web #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run tests | |
on: | |
pull_request: | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
env: | |
SUPER_SECRET: ${{ secrets.JWT_SECRET }} | |
MONGODB_URI_TEST: ${{ secrets.MONGODB_URI_TEST }} | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
# Backend | |
- name: Install backend dependencies | |
working-directory: ./backend | |
run: npm install | |
- name: Run backend tests | |
working-directory: ./backend | |
run: npm test | |
# Mobile | |
- name: Setup java | |
if: success() | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
cache: 'gradle' | |
- name: Set up Flutter | |
if: success() | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
cache: true | |
- name: Restore gradle.properties | |
if: success() | |
env: | |
GRADLE_PROPERTIES: ${{ secrets.GRADLE_PROPERTIES }} | |
shell: bash | |
run: | | |
mkdir -p ~/.gradle/ | |
echo "::set-env name=GRADLE_USER_HOME::$HOME/.gradle" | |
echo ${GRADLE_PROPERTIES} > ~/.gradle/gradle.properties | |
- name: Get flutter app dependencies | |
if: success() | |
working-directory: ./frontend/mobile | |
run: flutter pub get | |
- name: Start Android release build | |
if: success() | |
working-directory: ./frontend/mobile | |
env: | |
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }} | |
JWT_SECRET: ${{ secrets.JWT_SECRET }} | |
run: flutter build apk --dart-define PUBLIC_ACCESS_TOKEN="$MAPBOX_ACCESS_TOKEN" --dart-define BACKEND_BASE_URL=https://walkaware.onrender.com --dart-define JWT_SECRET="$JWT_SECRET" --dart-define FRONTEND_BASE_URL=https://walkaware-frontend.onrender.com | |
- name: Archive build result | |
uses: actions/upload-artifact@v4 | |
with: | |
name: mobile-app.apk | |
path: ./frontend/mobile/build/app/outputs/flutter-apk/app-release.apk |