forked from ChurchCRM/CRM
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (75 loc) · 2.31 KB
/
build-test-package.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
name: Build, Test and Package
on:
pull_request:
branches:
- master
paths-ignore:
- '**/*.md'
push:
branches:
- master
paths-ignore:
- '**/*.md'
jobs:
test-n-package:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['20.x']
steps:
- uses: actions/checkout@v4
with:
# fetch full history so things like auto-changelog work properly
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
# setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token. REQUIRED
registry-url: 'https://registry.npmjs.org'
- name: Declare some variables
id: vars
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@main
- name: Get Env Ready
run: |
npm ci
- name: Get Composer Cache Directory
id: composer-cache
run: |
cd src
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Build App
run: |
npm run package
- name: Run Docker
run: |
npm run ci-docker-test-start
docker compose -f docker/docker-compose.test-php8-apache.yaml ps -a
docker compose -f docker/docker-compose.test-php8-apache.yaml logs
- name: Test Server
run: |
curl -vvv http://127.0.0.1/api/public/echo
docker compose -f docker/docker-compose.test-php8-apache.yaml ps -a
docker compose -f docker/docker-compose.test-php8-apache.yaml logs
- name: Run Cypress Tests
run: |
npm run test
- name: Stop Docker
run: |
npm run ci-docker-test-down
- name: Upload zip file
uses: actions/upload-artifact@v4
with:
name: ChurchCRM-${{ steps.package-version.outputs.current-version}}-files
path: target/ChurchCRM-*.*