Fix CI for Gitea Actions: remove volume mount, run all commands in container
Build, Lint, and Test / Build, Lint, and Test (push) Failing after 1m36s
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.
This commit is contained in:
@@ -23,9 +23,6 @@ jobs:
|
||||
- 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
|
||||
|
||||
@@ -41,9 +38,10 @@ jobs:
|
||||
- name: Run Docker image
|
||||
run: docker compose up --detach
|
||||
|
||||
- name: Install Elixir and JS deps
|
||||
- name: Install deps
|
||||
run: |
|
||||
docker compose exec -T phx mix deps.get && yarn install && cd assets && yarn install && cd ..
|
||||
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: |
|
||||
@@ -53,5 +51,5 @@ jobs:
|
||||
- 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
|
||||
- name: Run tests
|
||||
run: docker compose exec -T phx mix test --trace
|
||||
@@ -5,11 +5,6 @@ services:
|
||||
dockerfile: ./docker/dev.Dockerfile
|
||||
environment:
|
||||
- MIX_ENV=test
|
||||
volumes:
|
||||
- '.:/app'
|
||||
# These lines ensure the deps can be saved as build artifacts for caching
|
||||
- '/app/deps'
|
||||
- '/app/_build'
|
||||
ports:
|
||||
- '4008:4008'
|
||||
command: tail -F /dev/null
|
||||
|
||||
Reference in New Issue
Block a user