fix: improve routing & UI #53
Workflow file for this run
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: Test | |
on: | |
push: | |
branches: | |
- "**" | |
pull_request: | |
types: [ opened, reopened ] | |
jobs: | |
test: | |
name: v${{ matrix.node }} @ ubuntu-latest | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: | |
- 18 | |
- 20 | |
steps: | |
- name: Setup | |
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4 | |
- name: Use Node.js v${{ matrix.node }} | |
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Setup .env file | |
run: cp .env.test .env | |
- name: Install dependencies | |
run: npm ci | |
- name: Get current commit hash | |
id: vars | |
run: echo "COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV | |
- name: Build | |
run: npm run build | |
env: | |
IMAGES_URL: https://raw.githubusercontent.com/ythepaut/image-showcase/${{ env.COMMIT_HASH }}/public/assets/images_test.json | |
- name: Run tests | |
run: npm test | |
- name: Run cypress tests | |
run: npm run e2e:headless | |
- name: Run lint | |
run: npm run lint | |
env: | |
IMAGES_URL: https://raw.githubusercontent.com/ythepaut/image-showcase/${{ env.COMMIT_HASH }}/public/assets/images_test.json | |
- name: SonarCloud Scan | |
uses: SonarSource/sonarcloud-github-action@master | |
env: | |
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |