Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:
- checks_requested

concurrency:
# Keep the event name in the group: sharing one group across events once let
# a release-authorizing push run deadlock behind other events for 13 hours.
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ permissions:
contents: read

concurrency:
# Keep the event name in the group: sharing one group across events once let
# a release-authorizing push run deadlock behind other events for 13 hours.
group: docs-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/exact-package-candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,8 @@ jobs:
target: google_apis
profile: pixel_2
script: |
# Gradle must run from the generated consumer directory, not the
# repository root, or it builds the wrong project.
cd "$RUNNER_TEMP/ReorderableConsumer/android" && ./gradlew app:installDebug --no-daemon -PnewArchEnabled=true -PhermesEnabled=true
adb shell am start -W -n com.reorderableconsumer/.MainActivity

Expand Down Expand Up @@ -576,6 +578,9 @@ jobs:
bundle install
bundle exec pod install --project-directory=ios
)
# build-framework-cache must run before detox build: without a
# prebuilt framework cache, Detox compiles it lazily mid-build and
# the Apple contract build fails on hosted runners.
yarn detox build-framework-cache
yarn detox build --configuration '${{ matrix.configuration }}'

Expand Down
223 changes: 0 additions & 223 deletions scripts/__tests__/ci-fixtures.test.mjs

This file was deleted.

99 changes: 99 additions & 0 deletions scripts/__tests__/consumer-scripts.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import assert from 'node:assert/strict';
import { execFileSync } from 'node:child_process';
import {
chmodSync,
mkdtempSync,
readFileSync,
statSync,
writeFileSync,
} from 'node:fs';
import { tmpdir } from 'node:os';
import { resolve } from 'node:path';
import test from 'node:test';

const repository = resolve(import.meta.dirname, '../..');

test('Expo clean consumers do not install the React Native community CLI', () => {
const fixture = mkdtempSync(resolve(tmpdir(), 'reorderable-consumer-'));
writeFileSync(
resolve(fixture, 'package.json'),
`${JSON.stringify({ dependencies: {} }, null, 2)}\n`
);

execFileSync(
process.execPath,
[
resolve(repository, 'scripts/configure-clean-consumer.mjs'),
fixture,
resolve(repository, 'candidate.tgz'),
'expo',
JSON.stringify({
react: '19.2.3',
reactNative: '0.86.2',
reactNativeGestureHandler: '3.2.1',
reactNativeReanimated: '4.5.3',
reactNativeWorklets: '0.11.4',
}),
],
{ stdio: 'pipe' }
);

const metadata = JSON.parse(
readFileSync(resolve(fixture, 'package.json'), 'utf8')
);
assert.equal(
metadata.devDependencies?.['@react-native-community/cli'],
undefined
);
});

test('the autolinking verifier accepts Expo platform-specific output', () => {
execFileSync(
process.execPath,
[
resolve(repository, 'scripts/verify-consumer-autolinking.mjs'),
'--platform',
'ios',
],
{
input: JSON.stringify({
dependencies: {
'react-native-reorderable': {
platforms: { ios: { podspecPath: 'Reorderable.podspec' } },
},
},
}),
stdio: ['pipe', 'pipe', 'pipe'],
}
);
});

test('the fmt workaround disables only the vulnerable 11.0.2 consteval branch', () => {
const fixture = mkdtempSync(resolve(tmpdir(), 'reorderable-fmt-'));
const header = resolve(fixture, 'base.h');
writeFileSync(
header,
`#define FMT_VERSION 110002
#elif defined(__cpp_consteval)
# define FMT_USE_CONSTEVAL 1
#elif FMT_GCC_VERSION >= 1002 || FMT_CLANG_VERSION >= 1101
# define FMT_USE_CONSTEVAL 1
`
);
chmodSync(header, 0o444);

const patcher = resolve(repository, 'scripts/patch-fmt-consteval.mjs');
execFileSync(process.execPath, [patcher, header]);
execFileSync(process.execPath, [patcher, header]);

const patched = readFileSync(header, 'utf8');
assert.match(
patched,
/#elif defined\(__cpp_consteval\)\n# define FMT_USE_CONSTEVAL 0/
);
assert.match(
patched,
/#elif FMT_GCC_VERSION >= 1002 \|\| FMT_CLANG_VERSION >= 1101\n# define FMT_USE_CONSTEVAL 1/
);
assert.equal(statSync(header).mode & 0o777, 0o444);
});
Loading
Loading