Appium Tests - Android workflow (codeceptjs/CodeceptJS)
The Appium Tests - Android workflow from codeceptjs/CodeceptJS, explained and optimized by Latchkey.
CI health: A - excellent
Point runs-on at Latchkey and get caching, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the Appium Tests - Android workflow from the codeceptjs/CodeceptJS repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: Appium Tests - Android
on:
push:
branches:
- 4.x
- appium-esm-migration
pull_request:
branches:
- 4.x
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CI: true
# Force terminal colors. @see https://www.npmjs.com/package/colors
FORCE_COLOR: 1
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
jobs:
appium:
runs-on: ubuntu-22.04
timeout-minutes: 30
strategy:
matrix:
node-version: [20.x]
test-suite: ['other', 'quick']
steps:
- uses: actions/checkout@v6
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- run: npm i
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: true
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
- name: Upload APK to Sauce Labs
run: |
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" \
--location --request POST 'https://api.us-west-1.saucelabs.com/v1/storage/upload' \
--form 'payload=@test/data/mobile/selendroid-test-app-0.17.0.apk' \
--form 'name="selendroid-test-app-0.17.0.apk"'
- run: 'timeout 900 bash -c "npm run test:appium-${{ matrix.test-suite }}"'
timeout-minutes: 20
The same workflow, on Latchkey
Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.
name: Appium Tests - Android on: push: branches: - 4.x - appium-esm-migration pull_request: branches: - 4.x concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true env: CI: true # Force terminal colors. @see https://www.npmjs.com/package/colors FORCE_COLOR: 1 SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} jobs: appium: runs-on: latchkey-small timeout-minutes: 30 strategy: matrix: node-version: [20.x] test-suite: ['other', 'quick'] steps: - uses: actions/checkout@v6 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v6 with: cache: 'npm' node-version: ${{ matrix.node-version }} - run: npm i env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: true PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true - name: Upload APK to Sauce Labs run: | curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" \ --location --request POST 'https://api.us-west-1.saucelabs.com/v1/storage/upload' \ --form 'payload=@test/data/mobile/selendroid-test-app-0.17.0.apk' \ --form 'name="selendroid-test-app-0.17.0.apk"' - run: 'timeout 900 bash -c "npm run test:appium-${{ matrix.test-suite }}"' timeout-minutes: 20
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Cache dependency installs on the setup step so they are served from cache.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- Network fetches
This workflow runs 1 job (2 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.