-
Notifications
You must be signed in to change notification settings - Fork 18
98 lines (85 loc) · 2.94 KB
/
ci.yaml
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
---
name: "Test & Build"
on:
push:
paths-ignore:
- "**.md"
env:
IMAGE_NAME: vatsim-scandinavia/control-center
TARGET_PLATFORMS: linux/amd64,linux/arm64
jobs:
build-container:
name: Build Control Center Container
runs-on: ubuntu-latest
steps:
- name: configure docker buildx
uses: docker/setup-buildx-action@4c0219f9ac95b02789c1075625400b2acbff50b1 # v2
- name: login to github container registry
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: setup container metadata
id: meta
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v4
with:
images: |
ghcr.io/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=pr
type=sha,event=branch,prefix=
type=semver,event=tag,pattern=v{{version}}
type=semver,event=tag,pattern=v{{major}}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
- name: build & push container image
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4
with:
context: "{{defaultContext}}:."
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ env.TARGET_PLATFORMS }}
test-app:
name: Control Center Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout Control Center
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
with:
path: controlcenter
- name: Checkout Handover
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
with:
repository: vatsim-scandinavia/handover
path: handover
- name: Setup dependencies for Handover
uses: ./controlcenter/.github/actions/setup-dependencies
with:
path: handover
setup-node: false
- name: Setup Handover
uses: ./controlcenter/.github/actions/setup-project
with:
path: handover
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
- name: Setup dependencies for Control Center
uses: ./controlcenter/.github/actions/setup-dependencies
with:
path: controlcenter
setup-node: true
- name: Setup Control Center
uses: ./controlcenter/.github/actions/setup-project
with:
path: controlcenter
setup-node: true
seed-database: true
env:
DB_CONNECTION: sqlite-testing
DB_HANDOVER_CONNECTION: sqlite-handover
DB_HANDOVER_DATABASE: ../handover/database/database.sqlite
- name: Execute unit and feature tests via PHPUnit
run: ./vendor/bin/phpunit --color=always --testdox
working-directory: ./controlcenter