diff --git a/.github/actions/composite/setupNode/action.yml b/.github/actions/composite/setupNode/action.yml index 95e187ff4d3a..d475acf5380f 100644 --- a/.github/actions/composite/setupNode/action.yml +++ b/.github/actions/composite/setupNode/action.yml @@ -4,10 +4,6 @@ description: Set up Node runs: using: composite steps: - - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - with: - fetch-depth: 0 - - uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 with: node-version-file: '.nvmrc' diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index a59eb8c0dbff..9ed2e9ed4e33 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -7,10 +7,14 @@ on: jobs: e2e-tests: if: ${{ github.event.label.name == 'e2e' }} - name: "Run e2e performance regression tests" + name: 'Run e2e performance regression tests' # Although the tests will run on an android emulator, using macOS as its more performant runs-on: macos-12 steps: + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + with: + fetch-depth: 0 + - uses: Expensify/App/.github/actions/composite/setupNode@main - uses: ruby/setup-ruby@eae47962baca661befdfd24e4d6c34ade04858f7 @@ -43,7 +47,7 @@ jobs: disable-animations: false script: echo "Generated AVD snapshot for caching." -# Note: if the android build fails the logs can be incomplete. It can help to run the build once manually to get a full log + # Note: if the android build fails the logs can be incomplete. It can help to run the build once manually to get a full log - name: Preheat build system env: JAVA_HOME: ${{ env.JAVA_HOME_11_X64 }} @@ -76,4 +80,3 @@ jobs: name: test-failure-logs path: e2e/.results retention-days: 5 - diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0af8907b085d..f41c02352097 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,6 +11,10 @@ jobs: if: ${{ github.actor != 'OSBotify' || github.event_name == 'workflow_call' }} runs-on: ubuntu-latest steps: + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + with: + fetch-depth: 0 + - uses: Expensify/App/.github/actions/composite/setupNode@main - run: npm run lint diff --git a/.github/workflows/platformDeploy.yml b/.github/workflows/platformDeploy.yml index 6aa397758ea2..c1cc0d3485e9 100644 --- a/.github/workflows/platformDeploy.yml +++ b/.github/workflows/platformDeploy.yml @@ -31,6 +31,10 @@ jobs: if: ${{ fromJSON(needs.validateActor.outputs.IS_DEPLOYER) }} runs-on: ubuntu-latest steps: + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + with: + fetch-depth: 0 + - uses: Expensify/App/.github/actions/composite/setupNode@main - uses: ruby/setup-ruby@eae47962baca661befdfd24e4d6c34ade04858f7 @@ -100,6 +104,10 @@ jobs: if: ${{ fromJSON(needs.validateActor.outputs.IS_DEPLOYER) }} runs-on: macos-12 steps: + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + with: + fetch-depth: 0 + - uses: Expensify/App/.github/actions/composite/setupNode@main - name: Decrypt Developer ID Certificate @@ -135,6 +143,10 @@ jobs: if: ${{ fromJSON(needs.validateActor.outputs.IS_DEPLOYER) }} runs-on: macos-12 steps: + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + with: + fetch-depth: 0 + - uses: Expensify/App/.github/actions/composite/setupNode@main - uses: ruby/setup-ruby@eae47962baca661befdfd24e4d6c34ade04858f7 @@ -219,6 +231,10 @@ jobs: if: ${{ fromJSON(needs.validateActor.outputs.IS_DEPLOYER) }} runs-on: ubuntu-latest steps: + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + with: + fetch-depth: 0 + - uses: Expensify/App/.github/actions/composite/setupNode@main - name: Setup Cloudflare CLI @@ -340,6 +356,10 @@ jobs: if: ${{ always() }} needs: [android, desktop, iOS, web] steps: + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + with: + fetch-depth: 0 + - uses: Expensify/App/.github/actions/composite/setupNode@main - name: Set version diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 90e6e06e75d2..8c303c580614 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,6 +39,10 @@ jobs: chunk: ${{fromJson(needs.config.outputs.MATRIX)}} steps: + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + with: + fetch-depth: 0 + - uses: Expensify/App/.github/actions/composite/setupNode@main # If automatic signing is enabled, iOS builds will fail, so ensure we always have the proper profile specified diff --git a/.github/workflows/testBuild.yml b/.github/workflows/testBuild.yml index 6ded7e7bb7e4..6b7619312677 100644 --- a/.github/workflows/testBuild.yml +++ b/.github/workflows/testBuild.yml @@ -1,16 +1,35 @@ name: Build and deploy apps for testing on: - pull_request: + pull_request_target: + types: [opened, synchronize] env: DEVELOPER_DIR: /Applications/Xcode_14.0.1.app/Contents/Developer jobs: + validateActor: + runs-on: ubuntu-latest + outputs: + IS_TEAM_MEMBER: ${{ fromJSON(steps.isUserDeployer.outputs.isTeamMember) }} + steps: + - id: isUserDeployer + uses: tspascoal/get-user-teams-membership@baf2e6adf4c3b897bd65a7e3184305c165aec872 + with: + GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} + username: ${{ github.actor }} + team: mobile-deployers + android: name: Build and deploy Android + needs: validateActor + if: ${{ fromJSON(needs.validateActor.outputs.IS_TEAM_MEMBER) }} runs-on: ubuntu-latest steps: + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} - uses: Expensify/App/.github/actions/composite/setupNode@main @@ -37,16 +56,24 @@ jobs: S3_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} S3_BUCKET: ad-hoc-expensify-cash S3_REGION: us-east-1 - - - uses: actions/upload-artifact@v2 + PULL_REQUEST_NAME: ${{ github.event.pull_request.title }} + + - uses: actions/upload-artifact@v3 with: name: android path: ./android_paths.json iOS: name: Build and deploy iOS + needs: validateActor + if: ${{ fromJSON(needs.validateActor.outputs.IS_TEAM_MEMBER) }} runs-on: macos-12 steps: + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + - uses: Expensify/App/.github/actions/composite/setupNode@main - uses: ruby/setup-ruby@eae47962baca661befdfd24e4d6c34ade04858f7 @@ -78,47 +105,55 @@ jobs: S3_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} S3_BUCKET: ad-hoc-expensify-cash S3_REGION: us-east-1 + PULL_REQUEST_NAME: ${{ github.event.pull_request.title }} - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: ios path: ./ios_paths.json - - web: - name: Build and deploy Web - runs-on: ubuntu-latest - steps: - - uses: Expensify/App/.github/actions/composite/setupNode@main - - - name: Configure AWS Credentials - # Version: 1.5.5 - uses: aws-actions/configure-aws-credentials@e97d7fbc8e0e5af69631c13daa0f4b5a8d88165b - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-1 - - name: Build web for staging - run: npm run build-staging - - - name: Build docs - run: npm run storybook-build - continue-on-error: true - - - name: Deploy to S3 for internal testing - run: aws s3 cp --recursive --acl public-read "$GITHUB_WORKSPACE"/dist s3://ad-hoc-expensify-cash/web/"$PULL_REQUEST_NAME" - env: - PULL_REQUEST_NAME: ${{ github.event.pull_request.title }} + # web: + # name: Build and deploy Web + # needs: validateActor + # if: ${{ fromJSON(needs.validateActor.outputs.IS_TEAM_MEMBER) }} + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + # with: + # fetch-depth: 0 + # ref: ${{ github.event.pull_request.head.sha }} + + # - uses: Expensify/App/.github/actions/composite/setupNode@main + + # - name: Configure AWS Credentials + # # Version: 1.5.5 + # uses: aws-actions/configure-aws-credentials@e97d7fbc8e0e5af69631c13daa0f4b5a8d88165b + # with: + # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # aws-region: us-east-1 + + # - name: Build web for staging + # run: npm run build-staging + + # - name: Build docs + # run: npm run storybook-build + # continue-on-error: true + + # - name: Deploy to S3 for internal testing + # run: aws s3 cp --recursive --acl public-read "$GITHUB_WORKSPACE"/dist s3://ad-hoc-expensify-cash/web/"$PULL_REQUEST_NAME" + # env: + # PULL_REQUEST_NAME: ${{ github.event.pull_request.title }} postGithubComment: runs-on: ubuntu-latest name: An example job to comment a PR - needs: [android, ios, web] + needs: [android, ios] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 - name: Read JSONs with paths id: set_var @@ -135,7 +170,9 @@ jobs: echo "::set-output name=ios_paths::$content_ios" - name: Comment PR - uses: thollander/actions-comment-pull-request@v1 + uses: thollander/actions-comment-pull-request@8732291afbb10a0a98adbb80269d2aa5a732182c with: message: | - 'Hello world ! ${{fromJson(steps.set_var.outputs.android_paths).html_path}} and ${{fromJson(steps.set_var.outputs.ios_paths).html_path}}'' \ No newline at end of file + | android :robot: | iOS :apple: | + | ------------- | ------------- | + | ${{fromJson(steps.set_var.outputs.android_paths).html_path}} | ${{fromJson(steps.set_var.outputs.ios_paths).html_path}} | diff --git a/.github/workflows/validateGithubActions.yml b/.github/workflows/validateGithubActions.yml index 4e51d785d6b0..051b20ed8e42 100644 --- a/.github/workflows/validateGithubActions.yml +++ b/.github/workflows/validateGithubActions.yml @@ -10,6 +10,10 @@ jobs: if: github.actor != 'OSBotify' runs-on: ubuntu-latest steps: + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + with: + fetch-depth: 0 + - uses: Expensify/App/.github/actions/composite/setupNode@main # Rebuild all the actions on this branch and check for a diff. Fail if there is one, diff --git a/.github/workflows/verifyPodfile.yml b/.github/workflows/verifyPodfile.yml index 17d80ca7e055..c7db42cc8cb5 100644 --- a/.github/workflows/verifyPodfile.yml +++ b/.github/workflows/verifyPodfile.yml @@ -10,6 +10,10 @@ jobs: if: github.actor != 'OSBotify' runs-on: ubuntu-latest steps: + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + with: + fetch-depth: 0 + - uses: Expensify/App/.github/actions/composite/setupNode@main - run: ./.github/scripts/verifyPodfile.sh diff --git a/fastlane/Fastfile b/fastlane/Fastfile index bd6e0c1a36ca..a2e0c757459b 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -42,7 +42,7 @@ platform :android do gradle( project_dir: './android', - task: 'bundle', + task: 'assemble', build_type: 'Release', ) @@ -53,7 +53,7 @@ platform :android do region: ENV['S3_REGION'], apk: lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH], - app_directory: 'android', + app_directory: "android/#{ENV['PULL_REQUEST_NAME']}", ) sh("echo '{\"apk_path\": \"#{lane_context[SharedValues::S3_APK_OUTPUT_PATH]}\",\"html_path\": \"#{lane_context[SharedValues::S3_HTML_OUTPUT_PATH]}\"}' > ../android_paths.json") @@ -155,7 +155,7 @@ platform :ios do region: ENV['S3_REGION'], ipa: lane_context[SharedValues::IPA_OUTPUT_PATH], - app_directory: 'ios', + app_directory: "android/#{ENV['PULL_REQUEST_NAME']}", ) sh("echo '{\"ipa_path\": \"#{lane_context[SharedValues::S3_IPA_OUTPUT_PATH]}\",\"html_path\": \"#{lane_context[SharedValues::S3_HTML_OUTPUT_PATH]}\"}' > ../ios_paths.json")