-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (51 loc) · 1.77 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
on:
pull_request:
branches:
- main
push:
branches:
- main
name: CI
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
env:
PHP_EXTENSIONS: dom, json, libxml, mbstring, pdo_sqlite, soap, xml, xmlwriter
steps:
- uses: actions/checkout@v3
with:
show-progress: false
- uses: php-actions/composer@v6
- name: Install docker-compose
uses: KengoTODA/actions-setup-docker-compose@v1
with:
version: '2.24.0'
- name: Information
run: |
docker-compose --version
# github.ref_name is the branch name on branch builds.
# On PRs ref_name is `PR#/merge`.
- name: Set runner name
if: github.event_name != 'pull_request'
run: |
echo "ASH_NAME=${{ github.ref_name }}" >> "$GITHUB_ENV"
echo "ASH_ENVIRONMENT_NAME=ash.${{ github.ref_name }}.local.computer" >> "$GITHUB_ENV"
- name: Set runner name
if: github.event_name == 'pull_request'
run: |
echo "ASH_NAME=pr${{ github.event.number }}" >> "$GITHUB_ENV"
echo "ASH_ENVIRONMENT_NAME=ash.pr${{ github.event.number }}.local.computer" >> "$GITHUB_ENV"
- name: Set variables
run: |
echo "DOCKER_HOSTNAME=${{ env.ASH_ENVIRONMENT_NAME }}" > .env
echo "ash_github_runners:
- repo_url: ${{ github.server_url }}/${{ github.repository }}
runner_token: ${{ secrets.RUNNER_TOKEN }}
runner_name: ${{ env.ASH_ENVIRONMENT_NAME }}
runner_labels: ci
user: platform
" > ansible/host_vars/${{ env.ASH_ENVIRONMENT_NAME }}.yml
cat ansible/host_vars/${{ env.ASH_ENVIRONMENT_NAME }}.yml
- name: Build Platform
run: composer dev:start