Feature/cypress login page e2e test (#185) #265
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: React Vite Build and Test | |
on: | |
push: | |
branches: | |
- 'main' | |
- 'dev' | |
pull_request: | |
branches: | |
- 'main' | |
- 'dev' | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: yarn install | |
- name: Build | |
run: yarn build | |
- name: Test build | |
run: | | |
if [ ! -d "build" ]; then | |
echo "Error: Build failed, build directory not found" | |
exit 1 | |
fi | |
- name: Run tests | |
run: yarn test --watchAll=false | |
env: | |
CI: true | |
REACT_APP_FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }} |