a891cb8902
Build, Lint, and Test / Build, Lint, and Test (push) Failing after 1m36s
The docker-compose.ci.yml mounted '.:/app' which works on GitHub Actions (where the workspace is the repo root) but not on Gitea Actions (where the workspace path differs). The built Docker image already has all files from COPY . ./ so the volume mount is unnecessary for CI. Also moved yarn install inside the container and run full test suite.
55 lines
1.3 KiB
YAML
55 lines
1.3 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: 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 deps
|
|
run: |
|
|
docker compose exec -T phx mix deps.get
|
|
docker compose exec -T phx sh -c "cd assets && yarn install"
|
|
|
|
- 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 tests
|
|
run: docker compose exec -T phx mix test --trace |