Repository navigation
Expand file tree
/
Copy pathcodemagic.yaml
More file actions
74 lines (72 loc) · 3.25 KB
/
Copy pathcodemagic.yaml
File metadata and controls
74 lines (72 loc) · 3.25 KB
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
# rn.green compatibility workflow. What it does, the credential it needs and how to run it are
# described in the README ("Compatibility workflow").
#
# Inputs reach the scripts only through environment.vars and are read there as environment variables.
# `${{ inputs.* }}` is never written into a script body: that is text substitution, and anyone who
# can start a build chooses the text.
workflows:
# One cell per build: a library version on a React Native version, started by hand. It checks the
# cell and sends the result to this repository as a pull request, so it holds GITHUB_TOKEN (group
# default). It also runs the library's own code (install scripts, tests, Gradle, CocoaPods):
# our scripts keep the token out of every command they start, but that is not isolation, which is
# why main must only change through a reviewed pull request (README, "Credentials").
compatibility-check:
name: Compatibility check
instance_type: mac_mini_m2
max_build_duration: 90
inputs:
package:
description: npm package name, as listed in green-packages.toml (with settings, and not disabled)
type: string
library_version:
description: Exact library version on a line green-packages.toml lists, for example 2.1.3
type: string
react_native_version:
description: Exact React Native version on a line green-packages.toml lists, for example 0.87.1 or 0.88.0-rc.3
type: string
environment:
groups:
- default
vars:
COMPAT_PACKAGE: ${{ inputs.package }}
COMPAT_LIBRARY_VERSION: ${{ inputs.library_version }}
COMPAT_REACT_NATIVE_VERSION: ${{ inputs.react_native_version }}
node: 22
java: 17
xcode: latest
cache:
cache_paths:
- $HOME/.gradle/caches
- $HOME/Library/Caches/CocoaPods
scripts:
# Setup. A failure here fails the build; there is no result, so nothing is recorded.
# First, before any library code is on the machine: can the token push? (Node's own modules only.)
- name: Check the token
script: node scripts/compat/check-token.mjs
- name: Install the catalog parser
script: npm ci --ignore-scripts
- name: Validate inputs
script: node scripts/compat/validate-inputs.mjs
- name: Check out the library at its release tag
script: node scripts/compat/checkout.mjs
- name: Swap React Native
script: node scripts/compat/swap.mjs
- name: Install
script: node scripts/compat/install.mjs
# Checks. Each records passed or failed (tests may be none) and lets the build continue.
- name: Test suite
script: node scripts/compat/check.mjs tests
- name: Android build
script: node scripts/compat/check.mjs android
- name: iOS build
script: node scripts/compat/check.mjs ios
- name: Save the result
script: node scripts/compat/compose-result.mjs
- name: Open a pull request with the result
script: node --experimental-strip-types --disable-warning=ExperimentalWarning scripts/compat/open-pr.mjs
artifacts:
- compat-results/result.json
- compat-results/inputs.json
- compat-results/swap.json
- compat-results/checks/*.json
- compat-results/logs/*