docs(README): Global explanation based on the docs #1255
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: Main workflow | |
on: [ push ] | |
env: | |
MIRROR_URL: "[email protected]:EpitechPromo2026/B-DEV-500-PAR-5-1-area-reza.rahemtola.git" | |
jobs: | |
build-supervisor: | |
name: "Build: Supervisor" | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./backend/supervisor/ | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Get changed files | |
uses: tj-actions/changed-files@v39 | |
id: changed-files | |
with: | |
files: 'backend/supervisor/**/*' | |
- name: Setup go | |
if: steps.changed-files.outputs.any_changed == 'true' | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: "backend/supervisor/go.mod" | |
cache-dependency-path: "backend/supervisor/go.sum" | |
- name: Install dependencies | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: | | |
go mod download | |
sudo apt-get install -y protobuf-compiler | |
go install google.golang.org/protobuf/cmd/[email protected] | |
go install google.golang.org/grpc/cmd/[email protected] | |
- name: Generate protobuf go files | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: | | |
git clone https://github.com/RezaRahemtola/area-proto.git proto | |
protoc --experimental_allow_proto3_optional --go_out=proto --go_opt=paths=source_relative --go-grpc_out=proto --go-grpc_opt=paths=source_relative --proto_path=proto proto/area_supervisor.proto proto/area_types.proto | |
- name: Run go build | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: go build | |
- name: Run go format | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: go fmt && git diff --exit-code | |
eslint-backend: | |
name: "ESLint: Backend" | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./backend/back/ | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Get changed files | |
uses: tj-actions/changed-files@v39 | |
id: changed-files | |
with: | |
files: 'backend/back/**/*' | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
if: steps.changed-files.outputs.any_changed == 'true' | |
with: | |
node-version: 18 | |
cache: yarn | |
cache-dependency-path: "backend/back/yarn.lock" | |
- name: Install dependencies | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: yarn install --frozen-lockfile --ignore-scripts | |
- name: Run eslint | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: yarn lint > eslint-results | |
- name: Get eslint results | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: eslint-back-results | |
path: backend/back/eslint-results | |
retention-days: 5 | |
unit-tests-backend: | |
name: "Unit tests: Backend" | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./backend/back/ | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Get changed files | |
uses: tj-actions/changed-files@v39 | |
id: changed-files | |
with: | |
files: 'backend/back/**/*' | |
- name: Setup node | |
if: steps.changed-files.outputs.any_changed == 'true' | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: yarn | |
cache-dependency-path: "backend/back/yarn.lock" | |
- name: Install dependencies | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: yarn install --frozen-lockfile | |
- name: Run unit tests | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: yarn test > unit-tests-results | |
- name: Get unit tests results | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: unit-tests-back-results | |
path: backend/back/unit-tests-results | |
retention-days: 5 | |
eslint-web: | |
name: "ESLint: Web" | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./frontend/web/ | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Get changed files | |
uses: tj-actions/changed-files@v39 | |
id: changed-files | |
with: | |
files: 'frontend/web/**/*' | |
- name: Setup node | |
if: steps.changed-files.outputs.any_changed == 'true' | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: yarn | |
cache-dependency-path: "frontend/web/yarn.lock" | |
- name: Install dependencies | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: yarn install --frozen-lockfile --ignore-scripts | |
- name: Run eslint | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: yarn lint > eslint-results | |
- name: Get eslint results | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: eslint-web-results | |
path: frontend/web/eslint-results | |
retention-days: 5 | |
end-to-end-tests-web: | |
name: "Cypress E2E: Web" | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./frontend/web/ | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Get changed files | |
uses: tj-actions/changed-files@v39 | |
id: changed-files | |
with: | |
files: 'frontend/web/**/*' | |
- name: Setup node | |
if: steps.changed-files.outputs.any_changed == 'true' | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: yarn | |
cache-dependency-path: "frontend/web/yarn.lock" | |
- name: Run cypress tests | |
if: steps.changed-files.outputs.any_changed == 'true' | |
uses: cypress-io/github-action@v6 | |
env: | |
CYPRESS_HOST: ${{ secrets.CYPRESS_API_URL }} | |
with: | |
working-directory: ./frontend/web | |
build: yarn build | |
start: yarn start | |
wait-on: "http://localhost:3000" | |
- name: Get screenshots | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cypress-screenshots | |
path: frontend/web/cypress/screenshots | |
retention-days: 5 | |
- name: Get videos | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cypress-videos | |
path: frontend/web/cypress/videos | |
retention-days: 5 | |
check-mobile: | |
name: "Mobile: Analyze code & run tests" | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./frontend/mobile/ | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Get changed files | |
uses: tj-actions/changed-files@v39 | |
id: changed-files | |
with: | |
files: 'frontend/mobile/**/*' | |
- name: Setup Java | |
if: steps.changed-files.outputs.any_changed == 'true' | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "temurin" | |
java-version: "17" | |
- name: Setup Flutter | |
if: steps.changed-files.outputs.any_changed == 'true' | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: "3.13.4" | |
channel: stable | |
cache: true | |
- name: Create dummy env file | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: touch .env | |
- name: Check formatting | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: dart format --set-exit-if-changed . | |
- name: Analyze code | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: flutter analyze | |
- name: Run tests | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: flutter test | |
push-to-mirror: | |
name: Push to Epitech repository | |
runs-on: ubuntu-latest | |
environment: Epitech repository | |
steps: | |
- name: Repository checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Cloning to mirror | |
uses: pixta-dev/repository-mirroring-action@v1 | |
with: | |
target_repo_url: | |
${{ env.MIRROR_URL }} | |
ssh_private_key: | |
${{ secrets.SSH_KEY }} | |
needs: | |
- build-supervisor | |
- eslint-backend | |
- unit-tests-backend | |
- eslint-web | |
- end-to-end-tests-web | |
- check-mobile |