-
Notifications
You must be signed in to change notification settings - Fork 102
127 lines (108 loc) · 3.61 KB
/
ci.yml
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: CI
on:
push:
branches: [ "master" ]
pull_request:
branches:
- master
env:
PHRASEANET_DOCKER_TAG: ${{ github.head_ref }}
REGISTRY: ghcr.io/${{ github.repository_owner }}
CACHE_REGISTRY: ghcr.io/${{ github.repository_owner }}
jobs:
build-phraseanet-setup:
name: 'build phraseanet-setup'
uses: ./.github/workflows/build.yml
with:
image: phraseanet-setup
context: .
file: ./Dockerfile
target: phraseanet-setup
secrets: inherit
build-phraseanet-nginx:
name: 'build phraseanet-nginx'
uses: ./.github/workflows/build.yml
with:
image: phraseanet-nginx
context: .
file: ./Dockerfile
target: phraseanet-nginx
secrets: inherit
build-phraseanet-fpm:
name: 'build phraseanet-fpm'
uses: ./.github/workflows/build.yml
with:
image: phraseanet-fpm
context: .
file: ./Dockerfile
target: phraseanet-fpm
secrets: inherit
build-phraseanet-worker:
name: 'build phraseanet-worker'
uses: ./.github/workflows/build.yml
with:
image: phraseanet-worker
context: .
file: ./Dockerfile
target: phraseanet-worker
secrets: inherit
build-phraseanet-db:
name: 'build phraseanet-db'
uses: ./.github/workflows/build.yml
with:
image: phraseanet-db
context: ./docker/db
file: ./docker/db/Dockerfile
target: ''
secrets: inherit
build-phraseanet-elasticsearch:
name: 'build phraseanet-elasticsearch'
uses: ./.github/workflows/build.yml
with:
image: phraseanet-elasticsearch
context: ./docker/elasticsearch
file: ./docker/elasticsearch/Dockerfile
target: ''
secrets: inherit
test:
name: 'unit test'
runs-on: ubuntu-latest
needs:
- build-phraseanet-setup
- build-phraseanet-nginx
- build-phraseanet-fpm
- build-phraseanet-worker
- build-phraseanet-db
- build-phraseanet-elasticsearch
steps:
- name: checkout
uses: actions/checkout@v3
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get tag name
if: github.event_name != 'pull_request'
shell: bash
run: echo "PHRASEANET_DOCKER_TAG=${{ github.ref_name }}" >> $GITHUB_ENV
- name: install
run: |
PHRASEANET_DOCKER_REGISTRY=${{ env.REGISTRY }} PHRASEANET_DOCKER_TAG=${{ env.PHRASEANET_DOCKER_TAG }} docker compose pull
PHRASEANET_DOCKER_REGISTRY=${{ env.REGISTRY }} PHRASEANET_DOCKER_TAG=${{ env.PHRASEANET_DOCKER_TAG }} docker compose up -d
- name: init tools test
run: |
docker compose exec -T -e PHRASEANET_BASE_URL=http://127.0.0.1 phraseanet docker/phraseanet/setup/init-test-install.sh
- name: test exclude-group legacy
run: |
docker compose exec -T phraseanet bin/console system:clear-cache
docker compose exec -T phraseanet php -d memory_limit=-1 vendor/phpunit/phpunit/phpunit --exclude-group legacy
- name: test group legacy and exclude-group web
run: |
docker compose exec -T phraseanet bin/console system:clear-cache
docker compose exec -T phraseanet php -d memory_limit=-1 vendor/phpunit/phpunit/phpunit --group legacy --exclude-group web
- name: test group web
run: |
docker compose exec -T phraseanet bin/console system:clear-cache
docker compose exec -T phraseanet php -d memory_limit=-1 vendor/phpunit/phpunit/phpunit --group web