Skip to content

Commit

Permalink
feat: add javascript workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
EshaanAgg committed Mar 4, 2024
1 parent 2217e9f commit 6fa2e6a
Showing 1 changed file with 97 additions and 0 deletions.
97 changes: 97 additions & 0 deletions .github/workflows/javascript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: JavaScript Pipeline

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
lint:
name: Linting JavaScript code
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "12"

- name: Cache node modules
uses: actions/cache@v2
with:
path: benchexec/tablegenerator/react-table/node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- name: Install dependencies
run: npm ci
working-directory: benchexec/tablegenerator/react-table

- name: Lint
run: npm run lint
working-directory: benchexec/tablegenerator/react-table

tests:
name: Run JavaScript tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "12"

- name: Cache node modules
uses: actions/cache@v2
with:
path: benchexec/tablegenerator/react-table/node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- name: Install dependencies
run: npm ci
working-directory: benchexec/tablegenerator/react-table

- name: Run tests
run: npm run test
working-directory: benchexec/tablegenerator/react-table

javascript-build:
name: Build JavaScript
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "12"

- name: Cache node modules
uses: actions/cache@v2
with:
path: benchexec/tablegenerator/react-table/node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- name: Install dependencies
run: npm ci
working-directory: benchexec/tablegenerator/react-table

- name: Build
run: |
npm run build
git diff --stat --exit-code
working-directory: benchexec/tablegenerator/react-table

0 comments on commit 6fa2e6a

Please sign in to comment.