feat: translate static website to hugo structure #8
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: Run basic checks | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: [main, dev] | |
types: # https://github.com/mistralai/mistral-common/blob/main/.github/workflows/lint_build_test.yaml | |
- reopened | |
- synchronize | |
- ready_for_review | |
# Run CI only when PR is ready for review or when commits are added | |
env: | |
TELESCOOP_DEV: true | |
IS_TESTING: true | |
jobs: | |
setup: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
- name: Install front js dependencies | |
run: npm install | |
working-directory: ./front | |
- name: Create back/local_settings.conf | |
run: echo "${{ secrets.LOCAL_SETTINGS_CONF }}" > local_settings.conf | |
working-directory: ./back | |
- name: Cache Python dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('back/requirements.txt') }} | |
- name: Cache Node.js dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ./front/node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('front/package-lock.json') }} | |
pre-commit: | |
runs-on: ubuntu-latest | |
needs: setup | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
- name: Restore Python cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('back/requirements.txt') }} | |
- name: Install python dependencies if not cached | |
if: steps.cache-python.outputs.cache-hit != 'true' | |
run: pip install -r back/requirements.txt | |
- name: Restore Node.js cache | |
uses: actions/cache@v3 | |
with: | |
path: ./front/node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('front/package-lock.json') }} | |
- name: Install js dependencies if not cached | |
if: steps.cache-node.outputs.cache-hit != 'true' | |
run: npm install | |
working-directory: ./front | |
- name: Enforce pre-commit hook server side | |
uses: pre-commit/[email protected] | |
node-setup: | |
runs-on: ubuntu-latest | |
needs: setup | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ./front/.nvmrc | |
cache: "npm" | |
- name: Restore Node.js cache | |
uses: actions/cache@v3 | |
with: | |
path: ./front/node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('front/package-lock.json') }} | |
- name: Install js dependencies if not cached | |
if: steps.cache-node.outputs.cache-hit != 'true' | |
run: npm install | |
working-directory: ./front | |
frontend-tests: | |
runs-on: ubuntu-latest | |
needs: [setup, node-setup] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ./front/.nvmrc | |
cache: "npm" | |
- name: Restore Node.js cache | |
uses: actions/cache@v3 | |
with: | |
path: ./front/node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('front/package-lock.json') }} | |
- name: Install front js dependencies if not cached | |
if: steps.cache-node.outputs.cache-hit != 'true' | |
run: npm install | |
working-directory: ./front | |
- name: Run vitest | |
run: npm run test | |
working-directory: ./front | |
- name: Run cypress component tests | |
uses: cypress-io/github-action@v6 | |
with: | |
component: true | |
working-directory: ./front | |
doc-tests: | |
runs-on: ubuntu-latest | |
needs: [setup] | |
steps: | |
- name: Run documentation validation | |
run: mkdocs build |