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

GitHub Actions workflow for Linux and Windows machines #4251

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 2 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
110 changes: 110 additions & 0 deletions .github/workflows/express-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# GitHub Action Workflow for building on Linux and Windows

name: Test

on:
mickeygousset marked this conversation as resolved.
Show resolved Hide resolved
push:
branches: [ master ]

jobs:

build:
name: Express Build
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
node-version: ["0.10", "0.12", "1.8", "2.5", "3.3", "4.9", "5.12", "6.17", "7.10", "8.17", "9.11", "10.19", "11.15", "12.16"]
os: [ubuntu-latest, windows-latest]
experimental: [false]
node-mirror: ["https://nodejs.org/dist/"]
include:
- node-version: 13
wesleytodd marked this conversation as resolved.
Show resolved Hide resolved
os: ubuntu-latest
node-mirror: "https://nodejs.org/download/nightly"
experimental: true
- node-version: 13
os: windows-latest
node-mirror: "https://nodejs.org/download/nightly"
experimental: true

steps:
- uses: actions/checkout@v2

- name: Set up node using nvm
mickeygousset marked this conversation as resolved.
Show resolved Hide resolved
uses: dcodeIO/setup-node-nvm@v4.0.0
with:
node-version: ${{ matrix.node-version }}
node-mirror: ${{ matrix.node-mirror }}

# Configure npm
# Skip updating shrinkwrap / lock
- run: npm config set shrinkwrap false
wesleytodd marked this conversation as resolved.
Show resolved Hide resolved

# Remove all non-test dependencies
# Remove example dependencies
- run: npm rm --silent --save-dev connect-redis

- name: Get Major Version Number of NodeJs Using Powershell
run: |
mickeygousset marked this conversation as resolved.
Show resolved Hide resolved
echo ${{ matrix.node-version }}
$mynodeVersion = "${{ matrix.node-version }}"
$mynodeMajorVersion = $mynodeVersion.split(".")[0]
echo "::set-env name=NodeMajorVersion::$mynodeMajorVersion"
shell: pwsh

# Setup Node.js version-specific dependencies

# mocha for testing
# - use 3.x for Node.js < 4
# - use 5.x for Node.js < 6
# - use 6.x for Node.js < 8
- name: Setup Node.js version-specific dependencies - mocha for testing - use 3.5.3 for Node.js < 4
run: npm install --silent --save-dev mocha@3.5.3
if: env.NodeMajorVersion < 4

- name: Setup Node.js version-specific dependencies - mocha for testing - use 5.2.0 for Node.js < 6
run: npm install --silent --save-dev mocha@5.2.0
if: env.NodeMajorVersion < 6 && env.NodeMajorVersion >= 4

- name: Setup Node.js version-specific dependencies - mocha for testing - use 6.2.2 for Node.js < 8
run: npm install --silent --save-dev mocha@6.2.2
if: env.NodeMajorVersion < 8 && env.NodeMajorVersion >= 6

# supertest for http calls
# - use 2.0.0 for Node.js < 4
# - use 3.4.2 for Node.js < 6
- name: Setup Node.js version-specific dependencies - supertest for http calls - use 2.0.0 for Node.js < 4
run: npm install --silent --save-dev supertest@2.0.0
if: env.NodeMajorVersion < 4

- name: Setup Node.js version-specific dependencies - supertest for http calls - use 3.4.2 for Node.js < 6
run: npm install --silent --save-dev supertest@3.4.2
if: env.NodeMajorVersion < 6 && env.NodeMajorVersion >= 4


# Update Node.js modules
# Prune and rebuild node_modules
- name: prune and rebuild node_modules
run: |
if (Test-Path -Path node_modules) {
npm prune
npm rebuild
}
shell: pwsh
mickeygousset marked this conversation as resolved.
Show resolved Hide resolved

- name: npm install
run: |
npm install

# Run test script
- run: npm run test-ci
# Run linting
- run: npm run lint

# Upload coverage to coveralls
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}