Fix cyrillic files bullshit #483
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/CD Workflow | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
branches: | |
- "main" | |
jobs: | |
svelte: | |
name: TypeScript & Svelte | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install Dependencies | |
run: | | |
cd frontend | |
npm i | |
- name: Run Svelte | |
run: | | |
cd frontend | |
npm run check | |
eslint: | |
name: ESLint & Prettier | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install Dependencies | |
run: | | |
cd frontend | |
npm i | |
- name: Run ESLint & Prettier | |
run: | | |
cd frontend | |
npm run lint | |
vitest: | |
name: Vitest | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install Dependencies | |
run: | | |
cd frontend | |
npm i | |
- name: Run Vitest | |
run: | | |
cd frontend | |
npm run test | |
ruff: | |
name: Ruff | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install Poetry | |
run: | | |
pip install poetry | |
cd backend | |
poetry install --no-root | |
- name: Run Ruff | |
run: | | |
cd backend | |
poetry run ruff check . | |
mypy: | |
name: MyPy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install Poetry | |
run: | | |
pip install poetry | |
cd backend | |
poetry install --no-root | |
- name: Run MyPy | |
run: | | |
cd backend | |
poetry run mypy . | |
pytest: | |
name: PyTest | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install Poetry | |
run: | | |
pip install poetry | |
cd backend | |
poetry install --no-root | |
- name: Run PyTest | |
run: | | |
cd backend | |
poetry run pytest | |
sonarcloud: | |
name: SonarCloud | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: SonarCloud Scan | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
docker-backend: | |
name: Docker Image (Backend) | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
needs: | |
- mypy | |
- ruff | |
- pytest | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and Push | |
uses: docker/build-push-action@v5 | |
with: | |
context: "{{defaultContext}}:backend" | |
push: true | |
tags: ${{ secrets.DOCKERHUB_USERNAME }}/synthra-backend:latest | |
docker-frontend: | |
name: Docker Image (Frontend) | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
needs: | |
- svelte | |
- eslint | |
- vitest | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and Push | |
uses: docker/build-push-action@v5 | |
with: | |
context: "{{defaultContext}}:frontend" | |
push: true | |
tags: ${{ secrets.DOCKERHUB_USERNAME }}/synthra-frontend:latest | |
build-args: | | |
VITE_BASE_URL=${{ vars.VITE_BASE_URL }} | |
gitlab-mirror: | |
name: GitLab Mirror | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Push to GitLab | |
env: | |
GITLAB_URL: ${{ secrets.GITLAB_URL }} | |
GITLAB_MAIL: ${{ secrets.GITLAB_MAIL }} | |
GITLAB_REPO: ${{ secrets.GITLAB_REPO }} | |
GITLAB_ORG: ${{ secrets.GITLAB_ORG }} | |
GITLAB_USERNAME: ${{ secrets.GITLAB_USERNAME }} | |
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }} | |
run: | | |
git config --global user.email "${GITLAB_MAIL}" | |
git config --global user.name "${GITLAB_USERNAME}" | |
git remote add gitlab "https://${GITLAB_USERNAME}:${GITLAB_TOKEN}@gitlab.finki.ukim.mk/ioss/synthra.git" | |
git push gitlab main:main --force |