Files
pinchflat/.gitea/workflows/ci.yml
T
hermes-agent 51f93c521e
Build, Lint, and Test / Build, Lint, and Test (push) Failing after 12m23s
Build, Lint, and Test / Build, Lint, and Test (pull_request) Failing after 1m16s
Fix CI branch names: master instead of main
2026-07-03 23:23:23 +00:00

57 lines
1.5 KiB
YAML

name: Build, Lint, and Test
on:
push:
branches:
- master
- feature/*
pull_request:
branches:
- master
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