diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a6d6553b37d..6db2beab6eb6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,14 +14,10 @@ on: - '**.md' - '.github/**' -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - jobs: - code_formatting: - name: Code Formatting - runs-on: ubuntu-24.04 + ci: + name: CI + runs-on: ubuntu-latest steps: - name: Checkout repository @@ -29,6 +25,8 @@ jobs: with: fetch-depth: 0 # required due to setting Spotless ratchetFrom submodules: recursive + token: ${{ secrets.GT_DAXMOBILE }} + ref: ${{ github.event.inputs.ref }} - name: Set up JDK version uses: actions/setup-java@v4 @@ -39,27 +37,13 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@v3 - - name: Run Code Formatting Checks - run: ./gradlew spotlessCheck - - unit_tests: - name: Unit tests - runs-on: android-large-runner - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Set up JDK version - uses: actions/setup-java@v4 + - name: Set up Go + uses: actions/setup-go@v5 with: - java-version-file: .github/.java-version - distribution: 'adopt' + go-version: '1.18.3' - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + - name: Run Code Formatting Checks + run: ./gradlew spotlessCheck - name: JVM tests run: ./gradlew jvm_tests @@ -75,30 +59,6 @@ jobs: name: unit-tests-report path: unit-tests-report.zip - lint: - name: Lint - runs-on: android-large-runner - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Set up JDK version - uses: actions/setup-java@v4 - with: - java-version-file: .github/.java-version - distribution: 'adopt' - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.18.3' - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 - - name: Lint run: ./gradlew lint @@ -113,40 +73,11 @@ jobs: name: lint-report path: lint-report.zip - android_tests: - runs-on: android-large-runner - name: Android CI tests - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Setup jq - uses: dcarbone/install-jq-action@v1.0.1 - with: - force: true - - - name: Set up JDK version - uses: actions/setup-java@v4 - with: - java-version-file: .github/.java-version - distribution: 'adopt' - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.18.3' - - name: Decode secret env: FLANK: ${{ secrets.FLANK }} run: echo "$FLANK" > flank.json - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 - - name: Build run: ./gradlew androidTestsBuild diff --git a/.github/workflows/notify_mattermost.yml b/.github/workflows/notify_mattermost.yml new file mode 100644 index 000000000000..24c78f628c72 --- /dev/null +++ b/.github/workflows/notify_mattermost.yml @@ -0,0 +1,53 @@ +name: Mattermost - Send Message + +on: + workflow_dispatch: + inputs: + mattermost-message: + description: 'Message to Send to Mattermost' + required: true + type: string + mattermost-channel-name: + description: 'Channel to Send the message to' + required: true + type: string + workflow_call: + inputs: + mattermost-message: + description: 'Message to Send to Mattermost' + required: true + type: string + mattermost-channel-name: + description: 'Channel to Send the message to' + required: true + type: string + secrets: + MM_AUTH_TOKEN: + required: true + MM_TEAM_ID: + required: true + +env: + ASANA_PAT: ${{ secrets.ASANA_ACCESS_TOKEN }} + emoji_start: ":flight_departure:" # 🛫 + emoji_info: ":information_source:" # ℹ️ + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + notify_mattermost: + name: Send Message to Mattermost + runs-on: macos-latest + + steps: + - name: Notify Mattermost of Release starting + id: send-mm-release-starting + uses: duckduckgo/native-github-asana-sync@v2.0 + with: + mattermost-token: ${{ secrets.MM_AUTH_TOKEN }} + mattermost-team-id: ${{ secrets.MM_TEAM_ID }} + mattermost-channel-name: ${{ github.event.inputs.mattermost-channel-name }} + mattermost-message: ${{ github.event.inputs.mattermost-message }} + action: 'send-mattermost-message' \ No newline at end of file diff --git a/.github/workflows/release_create_tag.yml b/.github/workflows/release_create_tag.yml index 56683af0e89e..14f4c9bcb2f2 100644 --- a/.github/workflows/release_create_tag.yml +++ b/.github/workflows/release_create_tag.yml @@ -7,6 +7,21 @@ on: description: 'App Version for Release' required: true default: 'PLACEHOLDER' + workflow_call: + inputs: + app-version: + description: 'App Version for Release' + required: true + type: string + secrets: + ASANA_ACCESS_TOKEN: + required: true + GT_DAXMOBILE: + required: true + MM_AUTH_TOKEN: + required: true + MM_TEAM_ID: + required: true env: ASANA_PAT: ${{ secrets.ASANA_ACCESS_TOKEN }} diff --git a/.github/workflows/release_create_task.yml b/.github/workflows/release_create_task.yml index fa096e555597..ab168dcd1495 100644 --- a/.github/workflows/release_create_task.yml +++ b/.github/workflows/release_create_task.yml @@ -7,6 +7,23 @@ on: description: 'App Version for Release' required: true default: 'PLACEHOLDER' + workflow_call: + inputs: + app-version: + description: 'App Version for Release' + required: true + type: string + outputs: + asana-task-url: + description: "The URL of the created Asana task" + value: ${{ jobs.create_release_task.outputs.asana_task_url }} + secrets: + ASANA_ACCESS_TOKEN: + required: true + MM_AUTH_TOKEN: + required: true + MM_TEAM_ID: + required: true env: ASANA_PAT: ${{ secrets.ASANA_ACCESS_TOKEN }} diff --git a/.github/workflows/release_full_process.yml b/.github/workflows/release_full_process.yml new file mode 100644 index 000000000000..788470ecf406 --- /dev/null +++ b/.github/workflows/release_full_process.yml @@ -0,0 +1,69 @@ +name: Release - Full Release Process + +on: + workflow_dispatch: + inputs: + app-version: + description: 'App Version for Release' + required: true + default: 'PLACEHOLDER' + +env: + emoji_start: ":flight_departure:" # 🛫 + emoji_info: ":information_source:" # ℹ️ + +concurrency: + group: ${{ github.workflow }}-${{ github.event.inputs.app-version }} + cancel-in-progress: true + +jobs: + notify_mattermost_start: + name: 'Step 1: Notify Mattermost of Release start' + uses: ./.github/workflows/notify_mattermost.yml + with: + mattermost-message: ${{env.emoji_start}} Starting release process for version ${{ github.event.inputs.app-version }} + mattermost-channel-name: ${{ vars.MM_RELEASE_NOTIFY_CHANNEL }} + secrets: inherit + + create_task: + name: 'Step 2: Create Asana Task' + uses: ./.github/workflows/release_create_task.yml + needs: notify_mattermost_start + with: + app-version: ${{ github.event.inputs.app-version }} + + run_release_tests: + name: 'Step 3: Run Release Tests' + needs: create_task + uses: ./.github/workflows/release_tests.yml + with: + app-version: ${{ github.event.inputs.app-version }} + test-tag: 'releaseTest' + secrets: inherit + + upload_play_store: + name: 'Step 4: Upload to Play Store' + needs: run_tests + uses: ./.github/workflows/release_upload_play_store.yml + with: + app-version: ${{ github.event.inputs.app-version }} + asana-task-url: ${{ needs.create_task.outputs.asana-task-url }} + secrets: inherit + + upload_internal: + name: 'Step 5: Upload Internal Build' + needs: run_tests + uses: ./.github/workflows/release_upload_internal.yml + with: + app-version: ${{ github.event.inputs.app-version }} + asana-task-url: ${{ needs.create_task.outputs.asana-task-url }} + secrets: inherit + + notify_mattermost_finish: + name: 'Step 1: Notify Mattermost of Release completed' + uses: ./.github/workflows/notify_mattermost.yml + needs: upload_play_store + with: + mattermost-message: ${{env.emoji_end}} Release ${{ github.event.inputs.app-version }} completed successfully and is now in review. + mattermost-channel-name: ${{ vars.MM_RELEASE_NOTIFY_CHANNEL }} + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/release_tests.yml b/.github/workflows/release_tests.yml index 1e952a54f4a0..6d200ccf4a34 100644 --- a/.github/workflows/release_tests.yml +++ b/.github/workflows/release_tests.yml @@ -12,6 +12,32 @@ on: required: true default: 'releaseTest' + workflow_call: + inputs: + app-version: + description: 'App Version for Release' + required: true + type: string + test-tag: + description: 'Maestro Tests tag to include' + required: true + default: 'releaseTest' + type: string + secrets: + ASANA_ACCESS_TOKEN: + required: false + FAKE_RELEASE_PROPERTIES: + required: true + FAKE_RELEASE_KEY: + required: true + MM_AUTH_TOKEN: + required: true + MM_TEAM_ID: + required: true + ROBIN_API_KEY: + required: true + + env: ASANA_PAT: ${{ secrets.ASANA_ACCESS_TOKEN }} emoji_info: ":information_source:" # ℹ️ diff --git a/.github/workflows/release_upload_internal.yml b/.github/workflows/release_upload_internal.yml index 102d36f5cb7e..2028435f9d9a 100644 --- a/.github/workflows/release_upload_internal.yml +++ b/.github/workflows/release_upload_internal.yml @@ -3,8 +3,24 @@ name: Release to Internal and Firebase on: schedule: - cron: '0 2 * * *' # run at 3 AM UTC - workflow_call: workflow_dispatch: + workflow_call: + secrets: + ASANA_ACCESS_TOKEN: + required: true + GT_DAXMOBILE: + required: true + UPLOAD_PLAY_CREDENTIALS: + required: true + UPLOAD_FIREBASE_CREDENTIALS: + required: true + MALICIOUS_SITE_PROTECTION_AUTH_TOKEN: + required: true + MM_AUTH_TOKEN: + required: true + MM_TEAM_ID: + required: true + env: ASANA_PAT: ${{ secrets.ASANA_ACCESS_TOKEN }} diff --git a/.github/workflows/release_upload_play_store.yml b/.github/workflows/release_upload_play_store.yml index 3c95ea777f84..9909c5dcf26c 100644 --- a/.github/workflows/release_upload_play_store.yml +++ b/.github/workflows/release_upload_play_store.yml @@ -1,17 +1,27 @@ name: Production Release to Play Store and Github on: - workflow_call: + workflow_dispatch: inputs: ref: description: 'Ref to build APK from (branch, tag, commit)' - type: string required: true - - workflow_dispatch: + workflow_call: inputs: ref: description: 'Ref to build APK from (branch, tag, commit)' + type: string + required: true + secrets: + ASANA_ACCESS_TOKEN: + required: true + GT_DAXMOBILE: + required: true + UPLOAD_PLAY_CREDENTIALS: + required: true + MM_AUTH_TOKEN: + required: true + MM_TEAM_ID: required: true env: diff --git a/.github/workflows/test_workflow.yml b/.github/workflows/test_workflow.yml index 73e4bfab55f8..a526f8141b4f 100644 --- a/.github/workflows/test_workflow.yml +++ b/.github/workflows/test_workflow.yml @@ -2,25 +2,39 @@ name: Test - Workflow for Testing on: workflow_dispatch: - inputs: - ref: - description: 'This is an example of an input' + app-version: + description: 'App Version for Release' required: true + default: 'PLACEHOLDER' -env: - ASANA_PAT: ${{ secrets.ASANA_ACCESS_TOKEN }} - GH_TOKEN: ${{ secrets.GT_DAXMOBILE }} +concurrency: + group: ${{ github.workflow }}-${{ github.event.inputs.app-version }} + cancel-in-progress: true jobs: - test-workflow: - runs-on: ubuntu-latest - name: Add here whatever steps you want to test + notify_mattermost_start: + name: 'Step 1: Notify Mattermost of Release start' + uses: ./.github/workflows/notify_mattermost.yml + with: + mattermost-message: ":flight_departure: Starting release process for version ${{ github.event.inputs.app-version }}" + mattermost-channel-name: ${{ vars.MM_TEST_NOTIFY_CHANNEL }} + secrets: inherit + + run_release_tests: + name: 'Step 3: Run Release Tests' + needs: notify_mattermost_start + uses: ./.github/workflows/release_tests.yml + with: + app-version: ${{ github.event.inputs.app-version }} + test-tag: 'omnibarTest' + secrets: inherit - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - submodules: recursive - token: ${{ secrets.GT_DAXMOBILE }} - ref: ${{ github.event.inputs.ref }} + notify_mattermost_finish: + name: 'Step 1: Notify Mattermost of Release completed' + uses: ./.github/workflows/notify_mattermost.yml + needs: run_release_tests + with: + mattermost-message: ":white_check_mark: Release ${{ github.event.inputs.app-version }} completed successfully and is now in review." + mattermost-channel-name: ${{ vars.MM_TEST_NOTIFY_CHANNEL }} + secrets: inherit \ No newline at end of file