This repository has been archived by the owner on Nov 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (53 loc) · 1.53 KB
/
build-test.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
name: Run-Tests
on:
pull_request:
branches: [ master, develop ]
jobs:
build-and-push:
runs-on: ubuntu-20.04
steps:
- name: Login To Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Pull latest image (for build cache)
run: docker pull ${{ secrets.DOCKER_HUB_USERNAME }}/doctrine-event-sourcing-php:latest
- name: Checkout
uses: actions/checkout@v2
- name: Build Docker Image
id: build-php
uses: ./.github/actions/build
with:
uname: dev
uid: 1001
gid: 1001
- name: Push Docker Image
run: |
IMAGE_TAG='${{ steps.build-php.outputs.image-tag }}'
docker push $IMAGE_TAG
echo $IMAGE_TAG
phpunit:
runs-on: ubuntu-20.04
needs:
- build-and-push
container: 'rela589n/doctrine-event-sourcing-php:${{ github.sha }}'
services:
test_db:
image: postgres:13-alpine
env:
POSTGRES_DB: des
POSTGRES_USER: des_user
POSTGRES_PASSWORD: p@$$w0rd
steps:
- uses: actions/checkout@v2
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Run Tests
uses: ./.github/actions/test