Skip to content

Commit

Permalink
finish test version
Browse files Browse the repository at this point in the history
  • Loading branch information
staszekscp committed Nov 23, 2022
1 parent 420dba9 commit 5f34e1d
Show file tree
Hide file tree
Showing 9 changed files with 116 additions and 44 deletions.
4 changes: 0 additions & 4 deletions .github/actions/composite/setupNode/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ description: Set up Node
runs:
using: composite
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8

This comment has been minimized.

Copy link
@AndrewGable

AndrewGable Nov 29, 2022

Contributor

I don't think we can remove this line, without it we do not have the nvm version in .nvmrc to use below. I think we've seen failures because of this.

cc @luacmartins @mountiny

with:
fetch-depth: 0

- uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version-file: '.nvmrc'
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/e2ePerformanceRegressionTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -76,4 +80,3 @@ jobs:
name: test-failure-logs
path: e2e/.results
retention-days: 5

4 changes: 4 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/platformDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
105 changes: 71 additions & 34 deletions .github/workflows/testBuild.yml
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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}}''
| android :robot: | iOS :apple: |
| ------------- | ------------- |
| ${{fromJson(steps.set_var.outputs.android_paths).html_path}} | ${{fromJson(steps.set_var.outputs.ios_paths).html_path}} |
4 changes: 4 additions & 0 deletions .github/workflows/validateGithubActions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/verifyPodfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ platform :android do

gradle(
project_dir: './android',
task: 'bundle',
task: 'assemble',
build_type: 'Release',
)

Expand All @@ -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")
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 5f34e1d

Please sign in to comment.