Skip to content

Commit

Permalink
ci: Read node version from nvmrc & switch to linux (#776)
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko authored Sep 21, 2021
1 parent 278a292 commit 9dd9587
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 7 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,22 @@ on:
jobs:
build:
name: Build
runs-on: windows-latest
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v2

- name: Read NodeJS version
id: nodejs-version
run: |
content=`cat ./.nvmrc`
echo "::set-output name=content::$content"
- name: setup node
uses: actions/setup-node@v1
with:
node-version: '12.x'
# See https://github.com/actions/setup-node/issues/32
node-version: ${{ steps.nodejs-version.outputs.content }}

- name: clean install dependencies
run: npm ci
Expand Down
36 changes: 31 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,17 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Use Node.js 14.x
-
name: Read Node.js version (Unix)
id: nodejs-version
run: |
content=`cat ./.nvmrc`
echo "::set-output name=content::$content"
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
# See https://github.com/actions/setup-node/issues/32
node-version: ${{ steps.nodejs-version.outputs.content }}
- name: npm install
run: npm install
- name: lint
Expand All @@ -27,17 +34,36 @@ jobs:
test:
strategy:
matrix:
os: [windows-latest, macos-latest, macos-11.0, ubuntu-latest]
os:
- windows-latest
- macos-latest
- macos-11.0
- ubuntu-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 10

steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Use Node.js 14.x
-
name: Read Node.js version (Unix)
if: ${{ runner.os != 'Windows' }}
id: nodejs-version-unix
run: |
content=`cat ./.nvmrc`
echo "::set-output name=content::$content"
-
name: Read Node.js version (Windows)
if: ${{ runner.os == 'Windows' }}
id: nodejs-version-win
run: |
$content = Get-Content .\.nvmrc -Raw
echo "::set-output name=content::$content"
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
# See https://github.com/actions/setup-node/issues/32
node-version: ${{ steps.nodejs-version-unix.outputs.content || steps.nodejs-version-win.outputs.content }}
- name: Set up Xvfb (Ubuntu)
run: |
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
Expand Down

0 comments on commit 9dd9587

Please sign in to comment.