172c1ff264
Build, Lint, and Test / Build, Lint, and Test (push) Failing after 13m0s
- Add /api/v1 namespace with Bearer token auth (PINCHFLAT_API_TOKEN env var) - API controllers for sources, media items, media profiles, settings, tasks - Support for all source actions: create, update, delete, force_download_pending, force_redownload, force_index, force_metadata_refresh, sync_files_on_disk - Media item endpoints: list, show, search, force_download, update, delete - Media profile CRUD endpoints - Settings show/update and app_info endpoints - Task listing endpoints - Add Jason.Encoder for Task schema - Comprehensive test suite for all API endpoints - Gitea Actions CI workflow (runs existing checks + API-specific tests) - API documentation in docs/API.md
57 lines
1.5 KiB
YAML
57 lines
1.5 KiB
YAML
name: Build, Lint, and Test
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- feature/*
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-test:
|
|
name: Build, Lint, and Test
|
|
runs-on: ubuntu-latest
|
|
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
|
|
env:
|
|
COMPOSE_FILE: ./docker-compose.ci.yml
|
|
MIX_ENV: test
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Pull prebuilt images
|
|
run: docker compose pull
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build docker image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./docker/dev.Dockerfile
|
|
load: true
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
|
|
- name: Run Docker image
|
|
run: docker compose up --detach
|
|
|
|
- name: Install Elixir and JS deps
|
|
run: |
|
|
docker compose exec -T phx mix deps.get && yarn install && cd assets && yarn install && cd ..
|
|
|
|
- name: Create and Migrate database
|
|
run: |
|
|
docker compose exec -T phx mix ecto.create
|
|
docker compose exec -T phx mix ecto.migrate
|
|
|
|
- name: Run code checks
|
|
run: docker compose exec -T phx mix check --no-fix --no-retry
|
|
|
|
- name: Run API tests
|
|
run: docker compose exec -T phx mix test test/pinchflat_web/controllers/api test/pinchflat_web/api_auth_plug_test.exs --trace |