rename #6
Workflow file for this run
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: Trufflebox UI CI | |
| on: | |
| pull_request: | |
| branches: [master, develop] | |
| paths: ['trufflebox-ui/**'] | |
| push: | |
| branches: [master, develop] | |
| paths: ['trufflebox-ui/**'] | |
| jobs: | |
| build-trufflebox-ui: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./trufflebox-ui | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Cache npm dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.npm | |
| trufflebox-ui/node_modules | |
| key: ${{ runner.os }}-npm-${{ hashFiles('trufflebox-ui/package.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-npm- | |
| - name: Install dependencies | |
| run: | | |
| if [ -f package-lock.json ]; then | |
| npm ci | |
| else | |
| npm install | |
| fi | |
| - name: Run linter | |
| run: npm run lint --if-present | |
| - name: Run tests | |
| run: npm test -- --passWithNoTests --watchAll=false || echo "No tests found or test command not available" | |
| - name: Build application | |
| run: npm run build --if-present | |
| - name: Test Docker build | |
| run: | | |
| docker build -t trufflebox-ui:test -f DockerFile . |