Skip to content

Commit

Permalink
ci: add gulp e2e test (#3318)
Browse files Browse the repository at this point in the history
* 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 <nison.mael@gmail.com>
  • Loading branch information
Daniel-McCarthy and arcanis committed Aug 20, 2021
1 parent 6455a8c commit 2036672
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/e2e-gulp-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
on:
schedule:
- cron: '0 */4 * * *'
push:
branches:
- master
pull_request:
paths:
- .github/workflows/e2e-gulp-workflow.yml
- scripts/e2e-setup-ci.sh

name: 'E2E Gulp'
jobs:
chore:
name: 'Validating Gulp'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master

- name: 'Install Node'
uses: actions/setup-node@master
with:
node-version: 14.x

- name: 'Build the standard bundle'
run: |
node ./scripts/run-yarn.js build:cli
- name: 'Run Gulp E2E test'
run: |
source scripts/e2e-setup-ci.sh
yarn init -p
yarn add -D gulp
# Test running Gulp with a simple default task.
echo "const gulp = require('gulp'); const defaultTaskPrintCheck = (cb) => { console.log('Success: ran gulp task'); cb(); }; exports.default = defaultTaskPrintCheck;" | tee gulpfile.js
yarn gulp
# Test using the Gulp API and run public task via CLI.
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
yarn gulp testGulpAPI
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ On top of our classic integration tests, we also run Yarn every day against the
[![](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/>
[![](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/>
[![](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/>
[![](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/>
[![](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/>
[![](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/>
[![](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/>
Expand Down
1 change: 1 addition & 0 deletions packages/gatsby/content/features/plugnplay.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ Many common frontend tools now support Plug'n'Play natively!
| Create-React-App | Starting from 2.0+ |
| ESLint | Some compatibility issues w/ shared configs |
| Gatsby | Supported with version ≥2.15.0, ≥3.7.0 |
| Gulp | Supported with version 4.0+ |
| Husky | Starting from 4.0.0-1+ |
| Jest | Starting from 24.1+ |
| Next.js | Starting from 9.1.2+ |
Expand Down

0 comments on commit 2036672

Please sign in to comment.