-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (69 loc) · 2.02 KB
/
tests.yml
File metadata and controls
83 lines (69 loc) · 2.02 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
80
81
82
83
---
name: tests
on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"
release:
types:
- created
jobs:
tests:
runs-on: ubuntu-20.04
strategy:
fail-fast: true
matrix:
php: [7.4, 8.0]
name: PHP ${{ matrix.php }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP environment
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring
tools: composer:v2
coverage: none
- name: Install dependencies
run: composer install
- name: Build container images
run: ./stack build
- name: Run unit/feature tests
run: ./stack test
- name: Build application
run: |
export VERSION=${GITHUB_REF##*/}
./stack app:build --build-version=$VERSION
if: github.event.release && matrix.php == 7.4
- name: Upload application build to release
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./builds/stack
asset_name: stack
asset_content_type: application/php
if: github.event.release && matrix.php == 7.4
- name: Log in to container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: github.event.release && matrix.php == 7.4
- name: Publish container images
run: |
docker push ghcr.io/sitepilot/lshttpd
docker push ghcr.io/sitepilot/backup
docker push ghcr.io/sitepilot/runtime:7.4
docker push ghcr.io/sitepilot/runtime:8.0
if: github.event.release && matrix.php == 7.4
- name: Debug
if: ${{ failure() }}
run: |
cat .env
cat stack.yml