diff --git a/.github/actions/setup-deps-nightly/action.yml b/.github/actions/setup-deps-nightly/action.yml new file mode 100644 index 000000000..587bbbed0 --- /dev/null +++ b/.github/actions/setup-deps-nightly/action.yml @@ -0,0 +1,32 @@ +name: Setup deps (nightly) +description: Setup Node.js and install dependencies + +runs: + using: composite + steps: + - name: Setup Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version-file: .nvmrc + + - name: Cache deps + id: yarn-cache + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + with: + path: | + ./node_modules + .yarn/install-state.gz + key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }} + restore-keys: | + ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} + ${{ runner.os }}-yarn- + + - name: Install deps + if: steps.yarn-cache.outputs.cache-hit != 'true' + run: yarn install --immutable + shell: bash + + - name: Switch to React Native Nightly + run: | + yarn remove react react-test-renderer react-native @react-native/babel-preset + yarn add -D react@19.1.0 react-test-renderer@19.1.0 react-native@nightly @react-native/babel-preset@nightly diff --git a/.github/workflows/react-native-nightly.yml b/.github/workflows/react-native-nightly.yml new file mode 100644 index 000000000..f9e87508e --- /dev/null +++ b/.github/workflows/react-native-nightly.yml @@ -0,0 +1,68 @@ +name: React Native Nightly +on: + # Runs every night at 5 AM + schedule: + - cron: '0 5 * * *' + # Manaual trigger + workflow_dispatch: + +# Set minimal permissions by default +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !contains(github.ref, 'main')}} + +jobs: + install-cache-deps: + runs-on: ubuntu-latest + name: Install and Cache deps + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Setup + uses: ./.github/actions/setup-deps + + lint: + needs: [install-cache-deps] + runs-on: ubuntu-latest + name: Lint + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Setup Node.js and deps + uses: ./.github/actions/setup-deps-nightly + + - name: Lint + run: yarn lint + + typecheck: + needs: [install-cache-deps] + runs-on: ubuntu-latest + name: Typecheck + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Setup Node.js and deps + uses: ./.github/actions/setup-deps-nightly + + - name: Typecheck + run: yarn typecheck + + test: + needs: [install-cache-deps] + runs-on: ubuntu-latest + name: Test React 18 + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Setup Node.js and deps + uses: ./.github/actions/setup-deps-nightly + + - name: Test + run: yarn test:ci