Skip to content

Commit

Permalink
test: action for api testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Toto-hitori committed Mar 3, 2024
1 parent e04a922 commit 093bd92
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 15 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ on:
push:
branches:
- master
- chore/actions-fixing
pull_request:
types: [opened, synchronize, reopened]
jobs:
unit-tests:
unit-tests-webapp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -15,10 +16,26 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/checkout@v4
- run: npm --prefix webapp ci
- run: npm --prefix webapp test -- --coverage
- run: cd api
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
unit-tests-api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- run: mvn test
working-directory: api
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
Expand Down
43 changes: 30 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,42 @@
name: Deploy on release

on:
push:
branches:
- 'chore/actions-fixing'
release:
types: [published]

jobs:
unit-tests:
unit-tests-webapp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm --prefix webapp ci
- run: npm --prefix webapp test -- --coverage
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/checkout@v4
- run: npm --prefix webapp ci
- run: npm --prefix webapp test -- --coverage
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
unit-tests-api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- run: mvn test
working-directory: api
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
e2e-tests:
Expand Down

0 comments on commit 093bd92

Please sign in to comment.