Move gitlab cicd to github actions #3
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: Lint and Test Frontend | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| lint-frontend: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./frontend | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20.x | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Set environment variables | |
| run: | | |
| echo "API_KEY=Test" >> $GITHUB_ENV | |
| - name: Lint frontend | |
| run: npm run lint | |
| component-tests: | |
| runs-on: ubuntu-latest | |
| needs: lint-frontend | |
| defaults: | |
| run: | |
| working-directory: ./frontend | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20.x | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Set test environment variables | |
| run: | | |
| echo "API_KEY=Test" >> $GITHUB_ENV | |
| - name: Build frontend Docker image for tests | |
| run: docker build -t frontend-test-image . | |
| - name: Bring up Docker Compose services | |
| run: docker compose up -d | |
| - name: Cypress.io component tests | |
| uses: cypress-io/github-action@v6.5.0 | |
| with: | |
| wait-on: http://localhost:3000/api/health | |
| wait-on-timeout: 120 | |
| command: npm run cy:run:ct |