From 4ebe59687f93809098bbfcda0515af66839cf4e6 Mon Sep 17 00:00:00 2001 From: Wiktor Sieprawski Date: Mon, 9 Oct 2023 10:37:22 +0200 Subject: [PATCH] Ci/use self hosted runner (#1931) * Add e2e iOS workflow * Dummy mobile change * Navigate to project's directory * Intentionally break the test * Use checkout and setup project * Use project directory * Don't reuse setup environment step * Correct step * Print location * Skip path * Install dependencies * Add more steps * Point to mobile dir * Dummy change * Git lfs * Fix test * Add Detox CI config * Decrease timeout * Use more labels for runner --- .github/workflows/e2e-ios.yml | 39 +++++++++++++++++++++++++++++++++++ packages/mobile/.detoxrc.js | 16 ++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .github/workflows/e2e-ios.yml diff --git a/.github/workflows/e2e-ios.yml b/.github/workflows/e2e-ios.yml new file mode 100644 index 0000000000..91c81888e1 --- /dev/null +++ b/.github/workflows/e2e-ios.yml @@ -0,0 +1,39 @@ +name: E2E iOS + +on: + pull_request: + paths: + - packages/mobile/** + +jobs: + detox: + timeout-minutes: 10 + runs-on: [self-hosted, macOS, ARM64] + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + npm i + npm run lerna bootstrap --scope @quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/mobile,backend-bundle + + - name: Pull binaries + run: | + git lfs install + git lfs pull + + - name: Install pods + run: | + cd packages/mobile/ios + pod install + + - name: Build Detox + run: | + cd packages/mobile + detox build -c ios.sim.debug.ci + + - name: Run basic tests + run: | + cd packages/mobile + detox test starter -c ios.sim.debug.ci diff --git a/packages/mobile/.detoxrc.js b/packages/mobile/.detoxrc.js index bc474cbd22..43098872ad 100644 --- a/packages/mobile/.detoxrc.js +++ b/packages/mobile/.detoxrc.js @@ -56,6 +56,12 @@ module.exports = { type: 'iPhone 15 Pro', }, }, + simulator_ci: { + type: 'ios.simulator', + device: { + type: 'iPhone 15' + } + }, attached: { type: 'android.attached', device: { @@ -80,6 +86,16 @@ module.exports = { }, }, }, + 'ios.sim.debug.ci': { + device: 'simulator_ci', + app: 'ios.debug', + artifacts: { + rootDir: './e2e/artifacts/ios', + plugins: { + instruments: 'all', + }, + }, + }, 'ios.sim.storybook': { device: 'simulator', app: 'ios.storybook',