Skip to content

Commit

Permalink
Migrate from Azure Pipelines to GitHub Actions (#13222)
Browse files Browse the repository at this point in the history
Beyond just a pure migration, this also:

- Drops Node 14 usage from CI (which also removes the need for explicit
  npm 8 installs)
- Removes the "old node" test, which just checked that installing on old
  node failed. We shouldn't need to test that
- Consolidates the build & test workflows so we don't end up with
  a proliferation of workflows.
  • Loading branch information
zpao authored Jun 14, 2023
1 parent 0f5e990 commit 0a827f6
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 177 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: 'Build & Test'

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
name: 'Build (${{ matrix.os }}, Node ${{ matrix.node }})'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- 'ubuntu-latest'
node:
- '16'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Install dependencies
run: npm ci --prefer-offline
- name: Build
run: npm run build

integration:
name: 'Integration Tests (${{ matrix.os }}, Node ${{ matrix.node }})'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- 'ubuntu-latest'
- 'macos-latest'
- 'windows-latest'
node:
- '16'
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Install dependencies
run: npm ci --prefer-offline
# The integration tests are run with yarn, so we need to install it.
- name: Install yarn
run: npm i -g yarn
- name: Run integration tests
run: npm run test:integration

e2e-simple:
name: E2E Simple
uses: ./.github/workflows/e2e-base.yml
with:
testScript: 'tasks/e2e-simple.sh'

e2e-installs:
name: E2E Installs
uses: ./.github/workflows/e2e-base.yml
with:
testScript: 'tasks/e2e-installs.sh'

e2e-kitchensink:
name: E2E Kitchensink
uses: ./.github/workflows/e2e-base.yml
with:
testScript: 'tasks/e2e-kitchensink.sh'
19 changes: 0 additions & 19 deletions .github/workflows/build.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/e2e-base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
on:
workflow_call:
inputs:
testScript:
required: true
type: string

name: E2E

jobs:
test:
name: 'Test (${{ matrix.os }}, Node ${{ matrix.node }})'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- 'ubuntu-latest'
node:
- '16'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Install
run: npm ci --prefer-offline
- name: Initialize Global Git config
run: |
git config --global core.autocrlf false
git config --global user.name "Create React App"
git config --global user.email "[email protected]"
- name: Run tests
run: ${{ inputs.testScript }}
32 changes: 0 additions & 32 deletions .github/workflows/integration.yml

This file was deleted.

10 changes: 3 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '16'
cache: 'npm'
- name: Install npm@8
run: npm i -g npm@8
- name: Install
run: npm ci --prefer-offline
- name: Build
run: npm run build
- name: Alex
run: npm run alex
- name: Prettier
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Create React App [![Build Status](https://dev.azure.com/facebook/create-react-app/_apis/build/status/facebook.create-react-app?branchName=main)](https://dev.azure.com/facebook/create-react-app/_build/latest?definitionId=1&branchName=main) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-green.svg)](https://github.com/facebook/create-react-app/blob/main/CONTRIBUTING.md)
# Create React App [![Build & Test](https://github.com/facebook/create-react-app/actions/workflows/build-and-test.yml/badge.svg?branch=main)](https://github.com/facebook/create-react-app/actions/workflows/build-and-test.yml) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-green.svg)](https://github.com/facebook/create-react-app/blob/main/CONTRIBUTING.md)

<img alt="Logo" align="right" src="https://create-react-app.dev/img/logo.svg" width="20%" />

Expand Down
41 changes: 0 additions & 41 deletions azure-pipelines-test-job.yml

This file was deleted.

77 changes: 0 additions & 77 deletions azure-pipelines.yml

This file was deleted.

0 comments on commit 0a827f6

Please sign in to comment.