Skip to content
Snippets Groups Projects
hypha-ci.yml 2.99 KiB

name: Hypha CI

on:
  pull_request:
    branches:
      - main
  push:
    branches:
      - main
      - test

concurrency:
  group: ${{ github.workflow }}
  cancel-in-progress: true

jobs:
  lint-fe:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 16
          cache: 'npm'
      - name: install node dependencies
        run: npm install --quiet
      - name: run scss and js linting
        run: npm run lint

  test-fe:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 16
          cache: 'npm'
      - name: install node dependencies
        run: npm install --quiet
      - name: tun functional unit test cases [REACT.JS]
        run: npm run test:ci

  lint-be:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: '3.10'
          cache: 'pip'
          cache-dependency-path: '**/requirements*.txt'
      - name: install python dependencies
        run: |
          python3 -m venv venv
          . venv/bin/activate
          pip install --upgrade pip
          pip install wheel
          pip install -r requirements-dev.txt
      - name: run python linting
        run: |
          . venv/bin/activate
          make lint

  test-be:
    runs-on: ubuntu-latest
    env:
      DATABASE_URL: postgresql://hypha:hypha@localhost/hypha?sslmode=disable
      DJANGO_SETTINGS_MODULE: hypha.settings.test
      SEND_MESSAGES: false