Merge branch 'inventory' into dev #131
This file contains hidden or 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 | |
| on: | |
| push: | |
| branches: [main, dev, shift] | |
| pull_request: | |
| branches: [main, dev] | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| # Cancel redundant runs when a new push is made to the same branch | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| frontend: | |
| name: Frontend (Lint & Build) | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: frontend | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint | |
| run: npm run lint:ci | |
| - name: Build | |
| run: npm run build | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: frontend-dist | |
| path: frontend/dist | |
| retention-days: 7 | |
| backend: | |
| name: Backend (Build & Test) | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: backend | |
| services: | |
| mysql: | |
| image: mysql:8.0 | |
| env: | |
| MYSQL_ROOT_PASSWORD: test1234 | |
| MYSQL_DATABASE: smalltrend_test | |
| ports: | |
| - 3306:3306 | |
| options: >- | |
| --health-cmd="mysqladmin ping -h localhost" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| env: | |
| DB_URL: jdbc:mysql://localhost:3306/smalltrend_test?allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=UTC&createDatabaseIfNotExist=true | |
| DB_USERNAME: root | |
| DB_PASSWORD: test1234 | |
| JWT_SECRET: 5367566B59703373367639792F423F4528482B4D6251655468576D5A71347437 | |
| CLOUDINARY_CLOUD_NAME: ci_dummy | |
| CLOUDINARY_API_KEY: "000000000000000" | |
| CLOUDINARY_API_SECRET: ci_dummy_secret | |
| SPRING_SQL_INIT_MODE: never | |
| SPRING_JPA_DDL_AUTO: create-drop | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Java 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: "17" | |
| distribution: "temurin" | |
| cache: "maven" | |
| - name: Make Maven wrapper executable | |
| run: chmod +x mvnw | |
| - name: Compile (skip tests) | |
| run: ./mvnw -B compile -DskipTests | |
| - name: Run tests + JaCoCo coverage | |
| run: ./mvnw -B verify | |
| - name: Upload JaCoCo coverage report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jacoco-report | |
| path: target/site/jacoco | |
| retention-days: 7 | |
| - name: Upload JUnit test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: junit-test-results | |
| path: target/surefire-reports | |
| retention-days: 7 |