-
Notifications
You must be signed in to change notification settings - Fork 439
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.github: Add Javascript action (#826)
- Loading branch information
Showing
1 changed file
with
84 additions
and
0 deletions.
There are no files selected for viewing
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
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 }} |