Skip to content

Commit 2036672

Browse files
ci: add gulp e2e test (#3318)
* Add E2E test to validate Gulp with Yarn Adds an E2E test for coverage and validation that Yarn berry is able to install gulp successfully and then verify it can be used successfully. After installing gulp, a simple script is added to create a default gulp task that prints a statement. Running the gulp command runs the task, making sure the bare basic functionality is able to run. Then, in order to make sure that we are able to import and use the gulp api, a test is used to use the src function from gulp to load the script file that's running. Also, it makes sure we can use gulp with a specific task name as well. This should be a start to verifying gulp is installable with yarn and working as intended. * Shorten & Cleanup E2E scripts * Corrected filename to gulpfile.js so gulp will find it by default * Update e2e-gulp-workflow.yml * Add Gulp E2E badge to Readme Toolchains Adds badge to display the status of Gulp E2E tests to the ReadMe alongside the rest. * Update PlugnPlay.md to mention support for Gulp Gulp is successfully running with Yarn berry from version 4 and up. This adds it to the compatibility list. Yarn may potentially support earlier versions, but the E2E tests succeed for the 4 line, and not 3.91 and below due to varying issues. Co-authored-by: Maël Nison <[email protected]>
1 parent 6455a8c commit 2036672

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
on:
2+
schedule:
3+
- cron: '0 */4 * * *'
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
paths:
9+
- .github/workflows/e2e-gulp-workflow.yml
10+
- scripts/e2e-setup-ci.sh
11+
12+
name: 'E2E Gulp'
13+
jobs:
14+
chore:
15+
name: 'Validating Gulp'
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@master
20+
21+
- name: 'Install Node'
22+
uses: actions/setup-node@master
23+
with:
24+
node-version: 14.x
25+
26+
- name: 'Build the standard bundle'
27+
run: |
28+
node ./scripts/run-yarn.js build:cli
29+
30+
- name: 'Run Gulp E2E test'
31+
run: |
32+
source scripts/e2e-setup-ci.sh
33+
yarn init -p
34+
yarn add -D gulp
35+
36+
# Test running Gulp with a simple default task.
37+
echo "const gulp = require('gulp'); const defaultTaskPrintCheck = (cb) => { console.log('Success: ran gulp task'); cb(); }; exports.default = defaultTaskPrintCheck;" | tee gulpfile.js
38+
yarn gulp
39+
40+
# Test using the Gulp API and run public task via CLI.
41+
echo "const gulp = require('gulp'); const testGulpAPI = (cb) => { const scriptFile = gulp.src('./gulpfile.js'); if (scriptFile) { console.log('Success: used gulp API import.'); } cb(); }; exports.testGulpAPI = testGulpAPI;" | tee gulpfile.js
42+
yarn gulp testGulpAPI

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ On top of our classic integration tests, we also run Yarn every day against the
110110
[![](https://github.com/yarnpkg/berry/workflows/E2E%20Angular%20over%20PnPify/badge.svg?event=schedule)](https://github.com/yarnpkg/berry/blob/master/.github/workflows/e2e-pnpify-workflow.yml)<br/>
111111
[![](https://github.com/yarnpkg/berry/workflows/E2E%20CRA/badge.svg?event=schedule)](https://github.com/yarnpkg/berry/blob/master/.github/workflows/e2e-cra-workflow.yml)<br/>
112112
[![](https://github.com/yarnpkg/berry/workflows/E2E%20Gatsby/badge.svg?event=schedule)](https://github.com/yarnpkg/berry/blob/master/.github/workflows/e2e-gatsby-workflow.yml)<br/>
113+
[![](https://github.com/yarnpkg/berry/workflows/E2E%20Gulp/badge.svg?event=schedule)](https://github.com/yarnpkg/berry/blob/master/.github/workflows/e2e-gulp-workflow.yml)<br/>
113114
[![](https://github.com/yarnpkg/berry/workflows/E2E%20Next/badge.svg?event=schedule)](https://github.com/yarnpkg/berry/blob/master/.github/workflows/e2e-next-workflow.yml)<br/>
114115
[![](https://github.com/yarnpkg/berry/workflows/E2E%20Preact%20CLI/badge.svg?event=schedule)](https://github.com/yarnpkg/berry/blob/master/.github/workflows/e2e-preact-cli-workflow.yml)<br/>
115116
[![](https://github.com/yarnpkg/berry/workflows/E2E%20Vue-CLI/badge.svg?event=schedule)](https://github.com/yarnpkg/berry/blob/master/.github/workflows/e2e-vue-cli-workflow.yml)<br/>

packages/gatsby/content/features/plugnplay.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ Many common frontend tools now support Plug'n'Play natively!
128128
| Create-React-App | Starting from 2.0+ |
129129
| ESLint | Some compatibility issues w/ shared configs |
130130
| Gatsby | Supported with version ≥2.15.0, ≥3.7.0 |
131+
| Gulp | Supported with version 4.0+ |
131132
| Husky | Starting from 4.0.0-1+ |
132133
| Jest | Starting from 24.1+ |
133134
| Next.js | Starting from 9.1.2+ |

0 commit comments

Comments
 (0)