forked from expo/expo
-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (124 loc) · 4.92 KB
/
updates-e2e.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Updates e2e (enabled) EAS
on:
workflow_dispatch: {}
pull_request:
paths:
- .github/workflows/updates-e2e.yml
- packages/@expo/cli/**
- packages/@expo/config-plugins/**
- packages/@expo/env/**
- packages/@expo/metro-config/**
- packages/@expo/prebuild-config/**
- packages/expo/**
- packages/expo-asset/**
- packages/expo-font/**
- packages/expo-json-utils/**
- packages/expo-manifests/**
- packages/expo-modules-autolinking/**
- packages/expo-modules-core/**
- packages/expo-splash-screen/**
- packages/expo-structured-headers/**
- packages/expo-updates-interface/**
- packages/expo-updates/**
- templates/expo-template-bare-minimum/**
push:
branches: [main, 'sdk-*']
paths:
- .github/workflows/updates-e2e.yml
- packages/@expo/cli/**
- packages/@expo/config-plugins/**
- packages/@expo/env/**
- packages/@expo/metro-config/**
- packages/@expo/prebuild-config/**
- packages/expo/**
- packages/expo-asset/**
- packages/expo-font/**
- packages/expo-json-utils/**
- packages/expo-manifests/**
- packages/expo-modules-autolinking/**
- packages/expo-modules-core/**
- packages/expo-splash-screen/**
- packages/expo-structured-headers/**
- packages/expo-updates-interface/**
- packages/expo-updates/**
- templates/expo-template-bare-minimum/**
schedule:
- cron: '0 22 * * SUN' # 22:00 UTC every Sunday
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
platform: [ios, android]
variant: ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && fromJson('["updates_testing_debug", "updates_testing_release"]') || fromJson('["updates_testing_debug"]') }}
runs-on: ubuntu-22.04
timeout-minutes: 80
env:
UPDATES_PORT: 4747
steps:
- name: 👀 Checkout
uses: actions/checkout@v4
- name: ⬢ Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
- name: ➕ Add `bin` to GITHUB_PATH
run: echo "$(yarn global bin)" >> $GITHUB_PATH
- name: ♻️ Restore caches
uses: ./.github/actions/expo-caches
id: expo-caches
with:
yarn-workspace: 'true'
- name: 🧶 Yarn install
if: steps.expo-caches.outputs.yarn-workspace-hit != 'true'
run: yarn install --frozen-lockfile
- name: 🔧 Install eas-cli
run: yarn global add eas-cli
- name: 🌳 Add EXPO_REPO_ROOT to environment
run: echo "EXPO_REPO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV
- name: 🌐 Set updates host
run: echo "UPDATES_HOST=localhost" >> $GITHUB_ENV
- name: 🌐 Set updates port
run: echo "UPDATES_PORT=4747" >> $GITHUB_ENV
- name: 📦 Set platform for updates E2E build
run: echo "EAS_PLATFORM=${{ matrix.platform }}" >> $GITHUB_ENV
- name: 📦 Get artifacts path
run: mkdir -p artifact && echo "ARTIFACTS_DEST=$(pwd)/artifact" >> $GITHUB_ENV
- name: 📦 Get commit message
run: echo "COMMIT_MESSAGE=$(git log -1 --pretty=oneline | head -c1000)" >> $GITHUB_ENV
- name: 📦 Set test project location
run: echo "TEST_PROJECT_ROOT=$GITHUB_WORKSPACE/updates-e2e" >> $GITHUB_ENV
- name: 📦 Setup test project for updates E2E tests
run: yarn --silent ts-node --transpile-only ./packages/expo-updates/e2e/setup/create-eas-project.ts
- name: 🚀 Build with EAS for ${{ matrix.platform }}
uses: ./.github/actions/eas-build
id: build_eas
with:
platform: ${{ env.EAS_PLATFORM }}
profile: ${{ matrix.variant }}
projectRoot: './updates-e2e'
expoToken: ${{ secrets.EAS_BUILD_BOT_TOKEN }}
noWait: ${{ github.event.schedule }}
message: ${{ github.event.pull_request.title }}
- name: On ${{ matrix.platform }} workflow canceled
if: ${{ cancelled() && steps.build_eas.outputs.build_id }}
run: eas build:cancel ${{ steps.build_eas.outputs.build_id }}
working-directory: './updates-e2e'
env:
EXPO_TOKEN: ${{ secrets.EAS_BUILD_BOT_TOKEN }}
EAS_BUILD_PROFILE: ${{ matrix.variant }}
- name: 🔔 Notify on Slack
uses: 8398a7/action-slack@v3
if: failure() && (github.event_name == 'schedule' || github.event.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/heads/sdk-'))
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_api }}
MATRIX_CONTEXT: ${{ toJson(matrix) }}
with:
channel: '#expo-sdk'
status: ${{ job.status }}
fields: job,message,ref,eventName,author,took
author_name: Updates E2E