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: Add Javascript action #826

Merged
merged 1 commit into from
Mar 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}