Status form details #83
Workflow file for this run
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 CI TEST | |
on: | |
pull_request: | |
branches: [dev] | |
jobs: | |
flutter_test: | |
name: Run flutter test | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Java Version | |
uses: actions/setup-java@v1 | |
with: | |
java-version: "12.x" | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: "stable" | |
- name: Get flutter dependencies | |
run: flutter pub get | |
- name: Setup AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
aws-region: sa-east-1 | |
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/GithubActionsRole | |
role-session-name: github-action | |
- run: npm install -g @aws-amplify/cli | |
- name: Setup Amplify projects | |
run: | | |
AWSCLOUDFORMATIONCONFIG="{\ | |
\"configLevel\":\"general\",\ | |
\"useProfile\":true,\ | |
\"profileName\":\"default\",\ | |
\"accessKeyId\":\"${{ env.AWS_ACCESS_KEY_ID}}\",\ | |
\"secretAccessKey\":\"${{ env.AWS_SECRET_ACCESS_KEY}}\",\ | |
\"region\":\"sa-east-1\"\ | |
}" | |
CONFIG="{\ | |
\"ResDir\":\"lib\"\ | |
}" | |
FRONTEND="{\ | |
\"frontend\":\"flutter\",\ | |
\"config\":$CONFIG\ | |
}" | |
AMPLIFY="{\ | |
\"projectName\":\"${{ secrets.AMPLIFY_AUTH_PROJECT }}\",\ | |
\"appId\":\"${{ secrets.AMPLIFY_AUTH_APP_ID }}\",\ | |
\"envName\":\"dev\",\ | |
\"defaultEditor\":\"code\"\ | |
}" | |
PROVIDERS="{\ | |
\"awscloudformation\":$AWSCLOUDFORMATIONCONFIG\ | |
}" | |
amplify pull --amplify $AMPLIFY --frontend $FRONTEND --providers $PROVIDERS --yes | |
# Report: | |
- name: Install lcov | |
run: sudo apt-get install lcov | |
- name: Flutter Test | |
run: flutter test --coverage | |
- name: Create report | |
run: genhtml coverage/lcov.info -o coverage/html | |
- uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos | |
files: coverage/lcov.info | |
flags: unittests # optional | |
directory: coverage/ | |
functionalities: html | |
name: codecov-umbrella # optional | |
fail_ci_if_error: true # optional (default = false) | |
verbose: true # optional (default = false) | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: report | |
path: coverage/html/ |