Feedback link in footer #238
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 | |
on: | |
push: | |
jobs: | |
python-ci: | |
runs-on: ubuntu-latest | |
services: | |
minio: | |
image: lazybit/minio | |
env: | |
MINIO_ACCESS_KEY: rainfall-ci-minio-access-key | |
MINIO_SECRET_KEY: rainfall-ci-minio-secret-key | |
ports: | |
- 9000:9000 | |
- 9001:9001 | |
options: >- | |
--name minio | |
--health-cmd "curl -f http://localhost:9000/minio/health/live" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 3 | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12.x' | |
architecture: 'x64' | |
- name: Copy .env.ci | |
run: cp .env.ci .env | |
- name: Install faircamp dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y ffmpeg libvips42 | |
- name: Install python dependencies | |
run: | | |
python -m pip install --upgrade pip pipenv | |
pipenv install -d | |
- name: Download .deb file | |
run: wget https://simonrepp.com/faircamp/packages/faircamp_1.0.0-1+deb12_amd64.deb | |
- name: Install faircamp | |
run: sudo dpkg -i faircamp_1.0.0-1+deb12_amd64.deb | |
- name: Run tests | |
run: pipenv run pytest --cov=rainfall --cov-report=json:coverage.json | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
frontend-ci: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get yarn cache directory path | |
id: yarn-dep-cache-dir-path | |
run: cd rainfall-frontend && echo "YARN_CACHE_DIR=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
name: Setup Yarn dep cache | |
id: yarn-dep-cache | |
with: | |
path: ${{ steps.yarn-dep-cache-dir-path.outputs.YARN_CACHE_DIR }} | |
key: ${{ runner.os }}-yarn-dep-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn-dep- | |
- name: Install Javascript dependencies | |
run: cd rainfall-frontend && yarn install --frozen-lockfile | |
- name: Start frontend server | |
run: | | |
cd rainfall-frontend | |
yarn dev --port 4173 & | |
- name: Wait for frontend server to be up (10s) | |
run: sleep 5s | |
shell: bash | |
- name: Run frontend tests | |
run: | | |
cd rainfall-frontend | |
$(yarn bin)/cypress run --e2e | |
- uses: actions/upload-artifact@v3 | |
continue-on-error: true | |
if: always() | |
with: | |
name: screenshots | |
path: rainfall-frontend/cypress/screenshots/* | |
build-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Javascript dependencies | |
run: cd rainfall-frontend && yarn install --frozen-lockfile | |
- name: Frontend builds successfully | |
run: | | |
cd rainfall-frontend | |
yarn run build |