-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (63 loc) · 2.21 KB
/
ci.yml
File metadata and controls
79 lines (63 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: CI
on:
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
env:
COMPOSE_FILE: docker-compose.yml:docker-compose.ci.override.yml
COMPOSE_PROJECT_NAME: ci-${{ github.job }}-${{ github.run_id }}
steps:
- uses: actions/checkout@v4
- name: Build services
run: docker compose build
- name: Show service logs if failed
if: failure()
run: docker compose logs
- name: Container runs
run: docker compose run --rm --no-deps -T findingaid php -v
- name: Teardown
if: always()
run: docker compose down -v --remove-orphans
lint:
needs: build
runs-on: ubuntu-latest
# TODO: Fix the linting errors
# Report the failure, but don't stop the job
continue-on-error: true
env:
COMPOSE_FILE: docker-compose.yml:docker-compose.ci.override.yml
COMPOSE_PROJECT_NAME: ci-${{ github.job }}-${{ github.run_id }}
steps:
- uses: actions/checkout@v4
- name: Build services
run: docker compose build
- name: Show service logs if failed
if: failure()
run: docker compose logs
- name: Run linting inside app container
run: docker compose run --rm -T findingaid /opt/findingaid/vendor/bin/phpcs -w --exclude=Generic.Files.LineLength --standard=PSR12 /opt/findingaid/tests /opt/findingaid/app
- name: Teardown
if: always()
run: docker compose down -v --remove-orphans
unit-test:
needs: build
runs-on: ubuntu-latest
env:
COMPOSE_FILE: docker-compose.yml:docker-compose.ci.override.yml
COMPOSE_PROJECT_NAME: ci-${{ github.job }}-${{ github.run_id }}
steps:
- uses: actions/checkout@v4
- name: Build services
run: docker compose build
- name: Start services
run: docker compose up -d findingaid
- name: Show service logs if failed
if: failure()
run: docker compose logs
- name: Run tests inside app container
run: docker compose run --rm -T findingaid /opt/findingaid/vendor/bin/phpunit -c /opt/findingaid/phpunit.xml /opt/findingaid/tests
- name: Teardown
if: always()
run: docker compose down -v --remove-orphans