feat(macos): migrate init template from Objective-C to Swift #1622
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PR | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, edited] | |
| branches: [ "main", "*-stable", "release/*" ] | |
| concurrency: | |
| # Ensure single build of a pull request. `main` should not be affected. | |
| group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint-title: | |
| name: "Lint PR title" | |
| permissions: {} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| filter: blob:none | |
| fetch-depth: 0 | |
| - name: Setup toolchain | |
| uses: ./.github/actions/microsoft-setup-toolchain | |
| with: | |
| node-version: '22' | |
| cache-npm-dependencies: '' | |
| # We lint the PR title instead of the commit message to avoid script injection attacks. | |
| # Using environment variables prevents potential security vulnerabilities as described in: | |
| # https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions#example-of-a-script-injection-attack | |
| - name: Lint PR title | |
| env: | |
| PR_TITLE: ${{ github.event.pull_request.title }} | |
| run: | | |
| echo "$PR_TITLE" | npx @rnx-kit/commitlint-lite@2.0.0 | |
| build-website: | |
| name: "Build the website" | |
| permissions: {} | |
| if: github.base_ref == 'main' | |
| uses: ./.github/workflows/microsoft-build-website.yml | |
| npm-publish-dry-run: | |
| name: "NPM Publish (Dry Run)" | |
| permissions: {} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| filter: blob:none | |
| fetch-depth: 0 | |
| - name: Setup toolchain | |
| uses: ./.github/actions/microsoft-setup-toolchain | |
| with: | |
| node-version: '22' | |
| - name: Install dependencies | |
| run: yarn | |
| - name: Show pending version bumps | |
| run: yarn changeset status || true | |
| - name: Build packages | |
| run: yarn build | |
| - name: Simulate publish (dry run) | |
| run: | | |
| yarn workspaces foreach -vv --all --topological --no-private npm publish --tag dry-run --tolerate-republish --dry-run | |
| check-changesets: | |
| name: "Check for Changesets" | |
| permissions: {} | |
| runs-on: ubuntu-latest | |
| # Only required for PRs targeting stable branches; skip the version bump PR itself | |
| if: >- | |
| ${{ endsWith(github.base_ref, '-stable') | |
| && !startsWith(github.head_ref, 'changeset-release/') }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| filter: blob:none | |
| fetch-depth: 0 | |
| - name: Setup toolchain | |
| uses: ./.github/actions/microsoft-setup-toolchain | |
| with: | |
| node-version: '22' | |
| - name: Install dependencies | |
| run: yarn install --immutable | |
| - name: Validate changesets | |
| run: yarn change:check | |
| yarn-constraints: | |
| name: "Check Yarn Constraints" | |
| permissions: {} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| filter: blob:none | |
| fetch-depth: 0 | |
| - name: Setup toolchain | |
| uses: ./.github/actions/microsoft-setup-toolchain | |
| with: | |
| node-version: '22' | |
| - name: Install dependencies | |
| run: yarn | |
| - name: Check constraints | |
| run: yarn constraints | |
| javascript-tests: | |
| name: "JavaScript Tests" | |
| permissions: {} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| filter: blob:none | |
| fetch-depth: 0 | |
| - name: Setup toolchain | |
| uses: ./.github/actions/microsoft-setup-toolchain | |
| with: | |
| node-version: '22' | |
| - name: Install npm dependencies | |
| run: yarn install | |
| - name: Run Jest tests | |
| run: yarn test-ci | |
| - name: Run Flow type checker | |
| run: yarn flow-check | |
| - name: Run ESLint | |
| run: yarn lint | |
| - name: Run Prettier format check | |
| run: yarn format-check | |
| build-rntester: | |
| name: "Build RNTester" | |
| permissions: {} | |
| uses: ./.github/workflows/microsoft-build-rntester.yml | |
| prebuild-macos-core: | |
| name: "Prebuild macOS Core" | |
| permissions: {} | |
| uses: ./.github/workflows/microsoft-prebuild-macos-core.yml | |
| test-react-native-macos-init: | |
| name: "Test react-native-macos init" | |
| permissions: {} | |
| if: ${{ endsWith(github.base_ref, '-stable') }} | |
| uses: ./.github/workflows/microsoft-test-react-native-macos-init.yml | |
| # https://github.com/microsoft/react-native-macos/issues/2344 | |
| # Disable these tests because verdaccio hangs | |
| # react-native-test-app-integration: | |
| # name: "Test react-native-test-app integration" | |
| # permissions: {} | |
| # if: ${{ endsWith(github.base_ref, '-stable') }} | |
| # uses: ./.github/workflows/microsoft-react-native-test-app-integration.yml | |
| PR: | |
| name: "PR" | |
| if: always() | |
| permissions: {} | |
| runs-on: ubuntu-latest | |
| needs: | |
| - lint-title | |
| - npm-publish-dry-run | |
| - check-changesets | |
| - yarn-constraints | |
| - javascript-tests | |
| - build-rntester | |
| - prebuild-macos-core | |
| - test-react-native-macos-init | |
| # - react-native-test-app-integration | |
| steps: | |
| - name: Check for failures or cancellations | |
| if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} | |
| run: | | |
| echo "One or more required jobs failed or were cancelled." | |
| exit 1 | |
| - name: All required jobs passed | |
| run: echo "All required jobs completed successfully." |