Skip to content

Commit 0a827f6

Browse files
authored
Migrate from Azure Pipelines to GitHub Actions (facebook#13222)
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.
1 parent 0f5e990 commit 0a827f6

8 files changed

+115
-177
lines changed

.github/workflows/build-and-test.yml

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: 'Build & Test'
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
name: 'Build (${{ matrix.os }}, Node ${{ matrix.node }})'
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os:
19+
- 'ubuntu-latest'
20+
node:
21+
- '16'
22+
steps:
23+
- uses: actions/checkout@v3
24+
- uses: actions/setup-node@v3
25+
with:
26+
node-version: ${{ matrix.node }}
27+
cache: 'npm'
28+
- name: Install dependencies
29+
run: npm ci --prefer-offline
30+
- name: Build
31+
run: npm run build
32+
33+
integration:
34+
name: 'Integration Tests (${{ matrix.os }}, Node ${{ matrix.node }})'
35+
runs-on: ${{ matrix.os }}
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
os:
40+
- 'ubuntu-latest'
41+
- 'macos-latest'
42+
- 'windows-latest'
43+
node:
44+
- '16'
45+
steps:
46+
- uses: actions/checkout@v3
47+
- name: Setup node
48+
uses: actions/setup-node@v3
49+
with:
50+
node-version: ${{ matrix.node }}
51+
cache: 'npm'
52+
- name: Install dependencies
53+
run: npm ci --prefer-offline
54+
# The integration tests are run with yarn, so we need to install it.
55+
- name: Install yarn
56+
run: npm i -g yarn
57+
- name: Run integration tests
58+
run: npm run test:integration
59+
60+
e2e-simple:
61+
name: E2E Simple
62+
uses: ./.github/workflows/e2e-base.yml
63+
with:
64+
testScript: 'tasks/e2e-simple.sh'
65+
66+
e2e-installs:
67+
name: E2E Installs
68+
uses: ./.github/workflows/e2e-base.yml
69+
with:
70+
testScript: 'tasks/e2e-installs.sh'
71+
72+
e2e-kitchensink:
73+
name: E2E Kitchensink
74+
uses: ./.github/workflows/e2e-base.yml
75+
with:
76+
testScript: 'tasks/e2e-kitchensink.sh'

.github/workflows/build.yml

-19
This file was deleted.

.github/workflows/e2e-base.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
testScript:
5+
required: true
6+
type: string
7+
8+
name: E2E
9+
10+
jobs:
11+
test:
12+
name: 'Test (${{ matrix.os }}, Node ${{ matrix.node }})'
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os:
18+
- 'ubuntu-latest'
19+
node:
20+
- '16'
21+
steps:
22+
- uses: actions/checkout@v3
23+
- uses: actions/setup-node@v3
24+
with:
25+
node-version: ${{ matrix.node }}
26+
cache: 'npm'
27+
- name: Install
28+
run: npm ci --prefer-offline
29+
- name: Initialize Global Git config
30+
run: |
31+
git config --global core.autocrlf false
32+
git config --global user.name "Create React App"
33+
git config --global user.email "[email protected]"
34+
- name: Run tests
35+
run: ${{ inputs.testScript }}

.github/workflows/integration.yml

-32
This file was deleted.

.github/workflows/lint.yml

+3-7
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,13 @@ jobs:
66
lint:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
10-
- uses: actions/setup-node@v2
9+
- uses: actions/checkout@v3
10+
- uses: actions/setup-node@v3
1111
with:
12-
node-version: '14'
12+
node-version: '16'
1313
cache: 'npm'
14-
- name: Install npm@8
15-
run: npm i -g npm@8
1614
- name: Install
1715
run: npm ci --prefer-offline
18-
- name: Build
19-
run: npm run build
2016
- name: Alex
2117
run: npm run alex
2218
- name: Prettier

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 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)
1+
# 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)
22

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

azure-pipelines-test-job.yml

-41
This file was deleted.

azure-pipelines.yml

-77
This file was deleted.

0 commit comments

Comments
 (0)