Bump vite from 5.2.3 to 5.2.6 in /desofs_svelte_front_end in the npm_and_yarn group across 1 directory #179
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD Pipeline | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
buildFrontEnd: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Set up node.js 20.11 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install Dependencies | |
run: npm install | |
working-directory: ./desofs_svelte_front_end | |
- name: Run build | |
run: npm run build | |
working-directory: ./desofs_svelte_front_end | |
- name: Run format | |
run: npm run format | |
working-directory: ./desofs_svelte_front_end | |
- name: Run linter | |
run: npm run lint | |
working-directory: ./desofs_svelte_front_end | |
- name: Install conffeti | |
run: npx playwright install --with-deps | |
working-directory: ./desofs_svelte_front_end | |
# - name: Run unit tests | |
# run: npm run test:unit | |
# working-directory: ./desofs_svelte_front_end | |
# - name: Run Integration tests | |
# run: npx playwright test | |
# working-directory: ./desofs_svelte_front_end | |
- name: Run Check | |
run: npm run check | |
working-directory: ./desofs_svelte_front_end | |
buildBackEnd: | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:latest | |
env: | |
MYSQL_ROOT_PASSWORD: ${{ secrets.MYSQL_ROOT_PASSWORD }} | |
MYSQL_DATABASE: ${{ secrets.DESOFS_DB_DEV_DB_NAME }} | |
MYSQL_USER: ${{ secrets.DESOFS_DB_USER }} | |
MYSQL_PASSWORD: ${{ secrets.DESOFS_DB_PASS }} | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Create .env | |
run: | | |
touch .env | |
echo "MYSQL_ROOT_PASSWORD=rootpwd" >> .env | |
echo "DESOFS_DB_DEV_DB_NAME=data_desofs" >> .env | |
echo "DESOFS_DB_USER=cozinha" >> .env | |
echo "DESOFS_DB_PASS=123456789" >> .env | |
echo "DESOFS_DB_HOST=desofs_mysql_db" >> .env | |
echo "DESOFS_APP_SECRET=defaultappsecret" >> .env | |
working-directory: ./desofsApi | |
- name: Echo .env | |
run: cat .env | |
working-directory: ./desofsApi | |
- name: Wait for 20 seconds | |
run: sleep 10 | |
- name: Check Database Health | |
run: nc -zvw 1 cozinha_na_cozinha_mysql 3306 | |
continue-on-error: true | |
# Setup java version | |
- name: Set up Java 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'maven' | |
cache-dependency-path: 'desofsApi/pom.xml' | |
- name: Maven Clean | |
run: mvn clean | |
working-directory: ./desofsApi | |
- name: Maven Test | |
run: mvn test | |
working-directory: ./desofsApi | |
- name: Maven Package | |
run: mvn package | |
working-directory: ./desofsApi | |
- name: Upload Jar | |
uses: actions/upload-artifact@v4 | |
with: | |
name: desofsApi | |
path: ./desofsApi/target/desofsApi-0.0.1-SNAPSHOT.jar | |
# Initializes the CodeQL tools for scanning. | |
# - name: Initialize CodeQL | |
# uses: github/codeql-action/init@v2 | |
# with: | |
# languages: java | |
# - name: Autobuild | |
# uses: github/codeql-action/autobuild@v2 | |
# - name: Perform CodeQL Analysis | |
# uses: github/codeql-action/analyze@v2 | |
- name: Depcheck | |
uses: dependency-check/Dependency-Check_Action@main | |
env: | |
# actions/setup-java@v1 changes JAVA_HOME so it needs to be reset to match the depcheck image | |
JAVA_HOME: /opt/jdk | |
id: Depcheck | |
with: | |
project: 'test' | |
path: '.' | |
format: 'HTML' | |
out: 'reports' | |
args: > | |
--enableRetired | |
- name: Upload Test results | |
uses: actions/upload-artifact@master | |
with: | |
name: Depcheck report | |
path: ${{github.workspace}}/reports | |
push-to-dockerhub: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Set up node.js 20.11 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install Dependencies | |
run: npm install | |
working-directory: ./desofs_svelte_front_end | |
- name: Run build | |
run: npm run build | |
working-directory: ./desofs_svelte_front_end | |
- name: Set up Java 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'maven' | |
cache-dependency-path: 'desofsApi/pom.xml' | |
- name: Maven Package | |
run: mvn package -DskipTests | |
working-directory: ./desofsApi | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Build docker compose file | |
run: docker-compose build | |
- name: Print docker images | |
run: docker images | |
# tag the frontend image | |
- name: Tag Frontend image | |
run: docker tag desofs2024_m1b_2_desof-web:latest ${{ secrets.DOCKER_USERNAME }}/desofs2024_m1b_2-desof-web:latest | |
- name: Tag Backend image | |
run: docker tag desofs2024_m1b_2_desof-api:latest ${{ secrets.DOCKER_USERNAME }}/desofs2024_m1b_2-desof-api:latest | |
- name: Build and push frontend | |
run: docker push ${{ secrets.DOCKER_USERNAME }}/desofs2024_m1b_2-desof-web:latest | |
- name: Build and push backend | |
run: docker push ${{ secrets.DOCKER_USERNAME }}/desofs2024_m1b_2-desof-api:latest | |
needs: [buildFrontEnd, buildBackEnd] | |
docker-scout-api: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Docker Scout | |
id: docker-scout | |
uses: docker/scout-action@v1 | |
with: | |
command: cves,recommendations,quickview | |
image: ${{ secrets.DOCKER_USERNAME }}/desofs2024_m1b_2-desof-api:latest | |
to-latest: true | |
ignore-unchanged: true | |
write-comment: true | |
only-fixed: true | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
needs: | |
- push-to-dockerhub | |
docker-scout-web: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Docker Scout | |
id: docker-scout | |
uses: docker/scout-action@v1 | |
with: | |
command: cves,recommendations,quickview | |
image: ${{ secrets.DOCKER_USERNAME }}/desofs2024_m1b_2-desof-web:latest | |
to-latest: true | |
ignore-unchanged: true | |
write-comment: true | |
only-fixed: true | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
needs: | |
- push-to-dockerhub | |