517f3f0329
Build and Test / Build and Test (push) Failing after 7m34s
Replace build-push-action with docker compose build --no-cache to ensure the image always contains the latest code. Remove buildx action since we don't need it anymore.
47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
name: Build and Test
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- feature/*
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-test:
|
|
name: Build 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
|
|
DOCKER_BUILDKIT: 1
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build and run Docker image
|
|
run: |
|
|
docker compose build --no-cache
|
|
docker compose up --detach
|
|
|
|
- name: Install deps
|
|
run: |
|
|
docker compose exec -T phx mix deps.get
|
|
docker compose exec -T phx yarn install
|
|
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 |