Fix/username #818
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: Flutter | |
on: | |
push: | |
branches: | |
- "main" | |
- "Develop" | |
pull_request: | |
branches: | |
- "main" | |
- "Develop" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the branch | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
# Step 2: Set up the Flutter environment | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.24.1' | |
# Step 3: Create .env file with secrets | |
- name: Create .env file | |
run: | | |
echo "WEB_API_KEY=${{ secrets.WEB_API_KEY }}" >> .env | |
echo "WEB_APP_ID=${{ secrets.WEB_APP_ID }}" >> .env | |
echo "ANDROID_API_KEY=${{ secrets.ANDROID_API_KEY }}" >> .env | |
echo "ANDROID_APP_ID=${{ secrets.ANDROID_APP_ID }}" >> .env | |
echo "IOS_API_KEY=${{ secrets.IOS_API_KEY }}" >> .env | |
echo "IOS_APP_ID=${{ secrets.IOS_APP_ID }}" >> .env | |
echo "MESSAGE_SENDER_ID=${{ secrets.MESSAGE_SENDER_ID }}" >> .env | |
echo "PROJECT_ID=${{ secrets.PROJECT_ID }}" >> .env | |
echo "STORAGE_BUCKET=${{ secrets.STORAGE_BUCKET }}" >> .env | |
echo "AUTH_DOMAIN=${{ secrets.AUTH_DOMAIN }}" >> .env | |
echo "IOS_BUNDLE_ID=${{ secrets.IOS_BUNDLE_ID }}" >> .env | |
echo "DEFAULT_IMAGE_URL=${{ secrets.DEFAULT_IMAGE_URL }}" >> .env | |
echo "DEFAULT_BANNER_URL=${{ secrets.DEFAULT_BANNER_URL }}" >> .env | |
echo "RAWG_API_KEY=${{ secrets.RAWG_API_KEY }}" >> .env | |
echo "RAWG_API_KEY2=${{ secrets.RAWG_API_KEY2 }}" >> .env | |
echo "RAWG_API_KEY3=${{ secrets.RAWG_API_KEY3 }}" >> .env | |
echo "RAWG_API_KEY4=${{ secrets.RAWG_API_KEY4 }}" >> .env | |
echo "RAWG_API_KEY5=${{ secrets.RAWG_API_KEY5 }}" >> .env | |
echo "RAWG_API_KEY6=${{ secrets.RAWG_API_KEY6 }}" >> .env | |
shell: bash | |
# Step 4: Install all the dependencies | |
- name: Install dependencies | |
run: flutter pub get | |
# Step 5: Gette the newer dependancy versions | |
- name: Install dependancies newer versions | |
run: flutter pub upgrade | |
# Step 6: Make sure dependancies are up to date | |
- name: Make sure dependancies are up to date | |
run: flutter pub outdated | |
# Step 7: Analyze the project source | |
- name: Analyze project source | |
run: flutter analyze | |
# Step 8: Run the tests | |
- name: Run tests | |
run: flutter test --coverage | |
# Step 9: Upload coverage to Codecov | |
- name: Upload coverage to Codecov | |
if: always() | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage/lcov.info |