Skip to content

Commit

Permalink
ci: add test ci
Browse files Browse the repository at this point in the history
Refs: IS-8
  • Loading branch information
ythepaut committed Aug 15, 2024
1 parent 4d4d504 commit 8c8e885
Show file tree
Hide file tree
Showing 6 changed files with 422 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ENVIRONMENT=test

APP_NAME=Image Showcase
APP_DESCRIPTION=Open source image gallery
APP_KEYWORDS=image gallery, image showcase
APP_URL=https://showcase.ythepaut.com/

TIMEZONE=Europe/Paris
DEFAULT_LOCALE=fr
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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: Build
run: npm run build
- name: Run tests
run: npm test
- name: Run cypress tests
run: npm run e2e:headless
- name: Run lint
run: npm run lint
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ typings/

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache
Expand Down
Loading

0 comments on commit 8c8e885

Please sign in to comment.