Skip to content

Commit

Permalink
Merge pull request vitessio#9739 from tinyspeck/sarabee-ci-sigh
Browse files Browse the repository at this point in the history
Add CI workflow for vtadmin-web unit tests
  • Loading branch information
doeg authored Feb 25, 2022
2 parents be5e6ae + 2453baf commit afe22c6
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/vtadmin_web_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ jobs:
node-version: '16.13.0'

- name: Install dependencies
run: npm install
run: npm ci

- name: Build front-end
run: npm run build

# Cancel pending and in-progress runs of this workflow if a newer ref is pushed to CI.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
7 changes: 6 additions & 1 deletion .github/workflows/vtadmin_web_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
node-version: '16.13.0'

- name: Install dependencies
run: npm install
run: npm ci

# Using "if: always()" means each step will run, even if a previous
# step fails. This is nice because, for example, we want stylelint and
Expand All @@ -49,3 +49,8 @@ jobs:
- name: Run prettier
if: always()
run: npm run lint:prettier

# Cancel pending and in-progress runs of this workflow if a newer ref is pushed to CI.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
39 changes: 39 additions & 0 deletions .github/workflows/vtadmin_web_unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: vtadmin-web unit tests

# In specifying the 'paths' property, we need to include the path to this workflow .yml file.
# See https://github.community/t/trigger-a-workflow-on-change-to-the-yml-file-itself/17792/4)
on:
push:
paths:
- '.github/workflows/vtadmin_web_unit_tests.yml'
- 'web/vtadmin/**'
pull_request:
paths:
- '.github/workflows/vtadmin_web_unit_tests.yml'
- 'web/vtadmin/**'

defaults:
run:
working-directory: ./web/vtadmin

jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
# node-version should match package.json
node-version: '16.13.0'

- name: Install dependencies
run: npm ci

- name: Run unit tests
run: CI=true npm run test

# Cancel pending and in-progress runs of this workflow if a newer ref is pushed to CI.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Original file line number Diff line number Diff line change
Expand Up @@ -2898,7 +2898,7 @@ Object {
}
`;

exports[`formatTimeseriesMap timespan < 15 minutes: timespan < 15 minutes 1`] = `
exports[`formatTimeseriesMap timespan < max span: timespan < max span 1`] = `
Object {
"All": Array [
Object {
Expand Down

0 comments on commit afe22c6

Please sign in to comment.