maingockien01 is running CI on commit ce8d27b2f3377413086f41201a72ba71c1952abb for branch refs/pull/35/merge #33
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: CI | |
run-name: ${{ github.actor }} is running ${{ github.workflow }} on commit ${{ github.sha }} for branch ${{ github.ref }} | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} | |
DOCKER_TAG: ${{ secrets.DOCKER_USERNAME }}/team8:${{ github.sha }} | |
IS_PUSH_TO_MAIN: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
jobs: | |
build: | |
name: Build and push Docker image | |
runs-on: ubuntu-latest | |
concurrency: | |
group: build-${{ github.sha }} | |
cancel-in-progress: true | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Docker | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to Docker Hub | |
if: ${{ env.IS_PUSH_TO_MAIN }} | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ env.DOCKER_USERNAME }} | |
password: ${{ env.DOCKER_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: ${{ env.DOCKER_TAG }} | |
cache-from: type=registry,ref=${{ env.DOCKER_TAG }} | |
cache-to: type=inline | |
lint: | |
name: Lint code - Code style check | |
runs-on: ubuntu-latest | |
needs: build | |
concurrency: | |
group: lint-${{ github.sha }} | |
cancel-in-progress: true | |
steps: | |
- name: Run linter on workspace backend | |
id: backend | |
run: docker run ${{ env.DOCKER_TAG }} yarn workspace @team8/backend lint | |
- name: Run linter on workspace frontend | |
id: frontend | |
run: docker run ${{ env.DOCKER_TAG }} yarn workspace @team8/frontend lint | |
- name: Run linter on workspace types | |
id: types | |
run: docker run ${{ env.DOCKER_TAG }} yarn workspace @team8/types lint | |
- name: Run linter on workspace constants | |
id: constants | |
run: docker run ${{ env.DOCKER_TAG }} yarn workspace @team8/constants lint | |
- name: Run linter on workspace utils | |
id: utils | |
run: docker run ${{ env.DOCKER_TAG }} yarn workspace @team8/utils lint | |
tests-unit-backend: | |
name: Run unit tests on workspace backend | |
runs-on: ubuntu-latest | |
needs: build | |
concurrency: | |
group: tests-unit-backend-${{ github.sha }} | |
cancel-in-progress: true | |
steps: | |
- name: Run unit tests on workspace backend | |
id: backend | |
run: docker run ${{ env.DOCKER_TAG }} yarn workspace @team8/backend test:unit | |
tests-unit-frontend: | |
name: Run unit tests on workspace frontend | |
runs-on: ubuntu-latest | |
needs: build | |
concurrency: | |
group: tests-unit-frontend-${{ github.sha }} | |
cancel-in-progress: true | |
steps: | |
- name: Run unit tests on workspace frontend | |
id: frontend | |
run: docker run ${{ env.DOCKER_TAG }} yarn workspace @team8/frontend test:unit | |
tests-backend-e2e: | |
name: Run integration tests on workspace backend | |
runs-on: ubuntu-latest | |
needs: build | |
continue-on-error: true | |
concurrency: | |
group: tests-backend-e2e-${{ github.sha }} | |
cancel-in-progress: true | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Docker | |
uses: docker/setup-buildx-action@v3 | |
- name: Run e2e tests on workspace backend | |
id: backend | |
run: docker-compose up run apps-dev yarn workspace @team8/backend test:e2e |