Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

on:
push:
branches:
- master
pull_request:

jobs:
test:
name: Node.js ${{ matrix.node }} / Babel ${{ matrix.babel }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [6, 22, 24, 26]
babel: [7, 8]
exclude:
# Babel 8 requires Node.js 20+, so it cannot run on Node.js 6.
- node: 6
babel: 8
steps:
- uses: actions/checkout@v4

- name: Set up Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Install dependencies (Babel 7)
# --ignore-engines: dev-only tools such as eslint declare a newer
# minimum Node.js version, but they are not executed in this job
# (linting runs in its own job), so installing them on Node.js 6 is fine.
run: yarn install --frozen-lockfile --ignore-engines

- name: Upgrade dev dependencies to Babel 8
if: matrix.babel == 8
run: >-
yarn add --dev
@babel/core@^8.0.0
@babel/preset-env@^8.0.0

- name: Run tests
run: yarn test

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 26

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Lint
run: yarn lint
6 changes: 0 additions & 6 deletions .travis.yml

This file was deleted.

5 changes: 4 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ module.exports = function(grunt) {
compile: {
options: {
sourceMap: true,
presets: ["@babel/preset-env"],
// Target an old environment so that the test fixture is actually
// transpiled (e.g. classes -> functions) regardless of the default
// targets, which differ between Babel 7 and Babel 8.
presets: [["@babel/preset-env", { targets: { ie: "11" } }]],
},
files: {
"test/tmp/fixture-compiled.js": "test/fixtures/fixture.js",
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
> This readme is for grunt-babel v8 + Babel v7
> This readme is for grunt-babel v8 + Babel v7 or v8
> Check the [7.x branch](https://github.com/babel/grunt-babel/tree/7.x) for docs with Babel v6

# grunt-babel [![Build Status](https://travis-ci.org/babel/grunt-babel.svg?branch=master)](https://travis-ci.org/babel/grunt-babel)
# grunt-babel [![CI](https://github.com/babel/grunt-babel/actions/workflows/test.yml/badge.svg)](https://github.com/babel/grunt-babel/actions/workflows/test.yml)

> Use next generation JavaScript, today, with [Babel](https://babeljs.io)

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"scripts": {
"lint": "eslint .",
"format": "eslint . --fix",
"test": "yarn lint && grunt"
"test": "grunt"
},
"files": [
"tasks"
Expand All @@ -34,7 +34,7 @@
"compiler"
],
"peerDependencies": {
"@babel/core": "^7.0.0",
"@babel/core": "^7.0.0 || ^8.0.0",
"grunt": ">=0.4.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion tasks/babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ try {
} catch (err) {
if (err.code === "MODULE_NOT_FOUND") {
err.message +=
"\n grunt-babel@8 requires Babel 7.x (the package '@babel/core'). " +
"\n grunt-babel@8 requires Babel 7.x or 8.x (the package '@babel/core'). " +
"If you'd like to use Babel 6.x ('babel-core'), you should install 'grunt-babel@7'.";
}
throw err;
Expand Down
Loading