Skip to content

Commit

Permalink
.github: Add Javascript action (#826)
Browse files Browse the repository at this point in the history
  • Loading branch information
ix5 committed Mar 21, 2022
1 parent 7a1ae20 commit 42a6403
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/javascript-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Javascript client

on:
push:
paths:
- "package.json"
- "isso/js/**"
- ".github/workflows/javascript-client.yml"
pull_request:
paths:
- "package.json"
- "isso/js/**"
- ".github/workflows/javascript-client.yml"

jobs:
test:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [16]
fail-fast: false

steps:

- name: Check out repository code
uses: actions/checkout@v2

- name: Set up NodeJS ${{ matrix.node-version }} on ${{ matrix.os }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: package.json

- name: Install Javascript dependencies using npm
run: npm install

- name: Run Javascript Jest test suite - unit tests
run: npm run test-unit

build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [16]
fail-fast: false

steps:

- name: Check out repository code
uses: actions/checkout@v2

- name: Set up NodeJS ${{ matrix.node-version }} on ${{ matrix.os }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: package.json

- name: Install Javascript dependencies using npm
run: npm install

- name: Create Javascript client files
id: generate-client-files
run: |
make js
echo "::set-output name=client_min_files::$(ls isso/js/*.min.js)"
echo "::set-output name=client_dev_files::$(ls isso/js/*.dev.js{,.map})"
- name: Archive and upload generated minified client files
uses: actions/upload-artifact@v3
with:
name: client-minified
path: ${{ steps.generate-client-files.outputs.client_min_files }}

- name: Archive and upload generated development client files
uses: actions/upload-artifact@v3
with:
name: client-dev
path: ${{ steps.generate-client-files.outputs.client_dev_files }}

0 comments on commit 42a6403

Please sign in to comment.