Skip to content

Commit

Permalink
build: update gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
war1oc committed Jun 13, 2024
1 parent 4890ef5 commit a9d5e03
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 12 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/build-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
name: build

on:
push:
branches:
- master
pull_request:
branches: [master]
types: [opened, synchronize, reopened]

jobs:
build_pull_request:
run_build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20.14.0
- name: Cache node modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- name: Run build step
run: npm run build
24 changes: 17 additions & 7 deletions .github/workflows/sonarqube-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: SonarCloud build
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]

# Uncomment once you set up Sonarqube
# on:
# push:
# branches:
# - master
# pull_request:
# types: [opened, synchronize, reopened]

jobs:
sonarcloud:
name: SonarCloud
Expand All @@ -15,7 +18,14 @@ jobs:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20.14.0
- name: Cache node modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- name: Run test cov
run: npm run test:cov
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/tests-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: tests

on:
push:
branches:
- master
pull_request:
branches: [master]
types: [opened, synchronize, reopened]

jobs:
test_pull_request:
Expand All @@ -25,7 +28,14 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20.14.0
- name: Cache node modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- name: Run unit tests
run: npm test
Expand Down

0 comments on commit a9d5e03

Please sign in to comment.