Skip to content

Commit

Permalink
Created GitHub Actions Test Setup
Browse files Browse the repository at this point in the history
- Added a GitHub Actions workflow that runs whenever there is a push to the repo.
- Workflow includes two jobs:
    - A matrix job of node versions (10, 12, 14, 16, 18) and operating systems (Linux (ubuntu), Mac and Windows (2019 Enterprise)) that runs all tests against mock and then runs s3 tests against a bucket (located at us-east-1-bucket) specified as a repo secret.
    - A matrix job of and NW.js versions (0.64.0, 0.50.2) and node versions (10, 12, ,14, 16) that runs the NW.js test script.
  • Loading branch information
ronilan committed May 12, 2022
1 parent c2c54c5 commit 7b8b09a
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Push - Matrix Tests

on:
push:
workflow_dispatch:

jobs:
test-on-os-node-matrix:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-2019] # due to node-gyp & node compatibility issues, windows 2022 won't work for all node versions
node: [10, 12, 14, 16, 18]
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
S3_BUCKET: ${{ secrets.S3_BUCKET }}

name: Test Node ${{ matrix.node }} on ${{ matrix.os }}

steps:
- name: Checkout ${{ github.ref }}
uses: actions/checkout@v2

- name: Setup node ${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}

- name: NPM Install
run: npm install

- name: Configure Windows 2019
run: |
echo "/c/Program Files/Microsoft Visual Studio/2019/Enterprise/MSBuild/Current/Bin/" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
npm config set msvs_version 2019
if: ${{ matrix.os == 'windows-2019' }}

- name: Show Environment Info
run: |
printenv
node --version
npm --version
- name: Run All Tests (against mock)
run: npm test
env:
node_pre_gyp_mock_s3 : true

- name: Run S3 Tests (against ${{ env.S3_BUCKET }} bucket)
run: |
npm run bucket ${{ env.S3_BUCKET }}
npm run test:s3
if: ${{ env.S3_BUCKET != '' }}

test-nw:
runs-on: ubuntu-18.04 # at current config the nw test requires python 2 as default. hence use older linux version
strategy:
matrix:
node: [10, 12, 14, 16] # node 18 requires glibc GLIBC_2.28 not available on older version of linux
nw: [0.64.0, 0.50.2] # current version as of may 2022 and the one tested before introduction of this action.
name: NW.js ${{ matrix.nw }} on Node ${{ matrix.node }}

steps:
- name: Checkout ${{ github.ref }}
uses: actions/checkout@v2

- name: Setup node ${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}

- name: Run Script
run: ./scripts/test-node-webkit.sh ${{ matrix.nw }}

0 comments on commit 7b8b09a

Please sign in to comment.