-
Notifications
You must be signed in to change notification settings - Fork 5
46 lines (44 loc) · 1.24 KB
/
build-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
name: build-test
on:
push:
branches:
- 'main'
pull_request:
jobs:
build-test:
strategy:
matrix:
node-version:
- 20
- 22
runs-on: ubuntu-latest
if: github.repository == 'opensearch-project/automation-app'
steps:
- uses: actions/checkout@v4
- name: Set up node-${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies and build the code
run: npm install
- name: Verify styling
id: style_verify
run: npm run format-dryrun
- name: Verify styling failure msg
if: steps.style_verify.outcome == 'failure'
run: echo "Please run 'npm run format' before commiting the code!"
- name: Run build test
run: npm run build
- name: Run junit
run: npm run junit
- name: Upload results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload junit test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}