Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: switch to GitHub Actions #194

Merged
merged 3 commits into from Dec 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
@@ -0,0 +1 @@
* text eol=lf
34 changes: 34 additions & 0 deletions .github/workflows/main.yml
@@ -0,0 +1,34 @@
name: CI
on:
- push
- pull_request
jobs:
test:
name: Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node-version:
- 8
- 9
- 10
- 11
- 12
- 13
- 14
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run test
- run: npm run check-node-support
- uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
@@ -1,7 +1,6 @@
# Shx

[![Travis](https://img.shields.io/travis/shelljs/shx/master.svg?style=flat-square&label=unix)](https://travis-ci.org/shelljs/shx)
[![AppVeyor](https://img.shields.io/appveyor/ci/shelljs/shx/master.svg?style=flat-square&label=windows)](https://ci.appveyor.com/project/shelljs/shx/branch/master)
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fshelljs%2Fshx%2Fbadge%3Fref%3Dmaster&style=flat-square)](https://actions-badge.atrox.dev/shelljs/shx/goto?ref=master)
[![Codecov](https://img.shields.io/codecov/c/github/shelljs/shx/master.svg?style=flat-square&label=coverage)](https://codecov.io/gh/shelljs/shx)
[![npm version](https://img.shields.io/npm/v/shx.svg?style=flat-square)](https://www.npmjs.com/package/shx)
[![npm downloads](https://img.shields.io/npm/dm/shx.svg?style=flat-square)](https://www.npmjs.com/package/shx)
Expand Down
31 changes: 0 additions & 31 deletions appveyor.yml

This file was deleted.

28 changes: 9 additions & 19 deletions scripts/check-node-support.js
Expand Up @@ -50,19 +50,11 @@ function range(start, stop) {
return ret;
}

function checkTravis(minNodeVersion, maxNodeVersion, travisYaml) {
var expectedTravisVersions = range(minNodeVersion, maxNodeVersion);
var msg = 'Check Travis node_js versions';
assertDeepEquals(travisYaml.node_js, expectedTravisVersions, msg);
}

function checkAppveyor(minNodeVersion, maxNodeVersion, appveyorYaml) {
var expectedAppveyorVersions = range(minNodeVersion, maxNodeVersion)
.map(num => ({ nodejs_version: num.toString() }))
.reverse(); // Arbitrarily, we store appveyor in reverse order.
var msg = 'Check Appveyor environment.matrix versions';
assertDeepEquals(appveyorYaml.environment.matrix, expectedAppveyorVersions,
msg);
function checkGithubActions(minNodeVersion, maxNodeVersion, githubActionsYaml) {
var expectedVersions = range(minNodeVersion, maxNodeVersion);
var msg = 'Check GitHub Actions node_js versions';
assertDeepEquals(githubActionsYaml.jobs.test.strategy.matrix['node-version'],
expectedVersions, msg);
}

try {
Expand All @@ -71,13 +63,11 @@ try {
var pack = require('../package.json');
checkEngines(MIN_NODE_VERSION, pack);

var travisFileName = path.join(__dirname, '..', '.travis.yml');
var travisYaml = yaml.safeLoad(shell.cat(travisFileName));
checkTravis(MIN_NODE_VERSION, MAX_NODE_VERSION, travisYaml);
var githubActionsFileName = path.join(__dirname, '..', '.github', 'workflows',
'main.yml');
var githubActionsYaml = yaml.safeLoad(shell.cat(githubActionsFileName));
checkGithubActions(MIN_NODE_VERSION, MAX_NODE_VERSION, githubActionsYaml);

var appveyorFileName = path.join(__dirname, '..', 'appveyor.yml');
var appveyorYaml = yaml.safeLoad(shell.cat(appveyorFileName));
checkAppveyor(MIN_NODE_VERSION, MAX_NODE_VERSION, appveyorYaml);
console.log('All files look good (this project supports v'
+ MIN_NODE_VERSION + '-v' + MAX_NODE_VERSION + ')!');
} catch (e) {
Expand Down