Migrate Travis to Workflow #14
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: NodeJS with Grunt | |
on: | |
push: | |
branches: | |
- "release" | |
- "main" | |
- "master" | |
pull_request: | |
branches: | |
- "release" | |
- "main" | |
- "master" | |
# Enable manual trigger | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14.x, 16.x] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- name: Clean npm cache | |
run: npm cache clean --force | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential python3 gcc g++ make | |
- name: Setup Python 3 | |
run: | | |
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1 | |
python --version | |
- name: Update npm and node-gyp for Node 16 | |
if: matrix.node-version == '16.x' | |
run: | | |
npm install -g npm@latest | |
npm install -g node-gyp@latest | |
npm config set node_gyp $(npm prefix -g)/lib/node_modules/node-gyp/bin/node-gyp.js | |
- name: Install Grunt CLI | |
run: npm install -g grunt-cli | |
- name: Install node-sass for Node 14 | |
if: matrix.node-version == '14.x' | |
run: | | |
npm config set sass-binary-site=https://github.com/sass/node-sass/releases/download | |
npm install [email protected] --save-dev --force | |
npm rebuild node-sass | |
- name: Install node-sass for Node 16 | |
if: matrix.node-version == '16.x' | |
run: | | |
npm config set sass-binary-site=https://github.com/sass/node-sass/releases/download | |
npm install [email protected] --save-dev --force | |
npm rebuild node-sass --update-binary | |
- name: Install specific dependencies first | |
run: | | |
npm install [email protected] --save-dev --force | |
npm install [email protected] --save-dev --force | |
npm install [email protected] --save-dev --force | |
npm install [email protected] --save-dev --force | |
npm install [email protected] --save-dev --force | |
- name: Install remaining dependencies | |
run: npm install --legacy-peer-deps --no-audit --force | |
- name: Display versions | |
run: | | |
npm -v | |
node -v | |
python --version | |
gcc --version | |
node-gyp -v | |
- name: Run Grunt | |
run: grunt --verbose |