-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (82 loc) · 2.78 KB
/
exist.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
89
90
91
92
93
94
95
96
# This workflow builds a xar archive, deploys it into exist and execute its test suites.
# It also includes code for using semantic-release to upload packages as part of GitHub releases
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: exist-db CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
exist-version: [latest, release]
java-version: [8]
node-version: ['14', '16']
# TODO: see #563 could still be usefull for gulp builds
# services:
# # Label used to access the service container
# exist:
# image: existdb/existdb:${{ matrix.exist-version}}
# ports:
# - 8080:8080
steps:
# Checkout code
- uses: actions/checkout@v2
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
# Build Frontend
- name: Build Frontend Using Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
# Build Expath Package
# TODO: #563 make optional for gulp builds
- name: Build Expath Package
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java-version }}
- run: ant
# Deploy Package in Container
- name: Pull Base Image
run: docker pull existdb/existdb:${{ matrix.exist-version }}
- name: Create CI Container
run: docker create --name exist-ci -p 8080:8080 existdb/existdb:${{ matrix.exist-version }}
- name: Prep CI Container
run: docker cp ./build/*-dev.xar exist-ci:exist/autodeploy
- name: Start Exist Container
run: docker start exist-ci && sleep 30
# Testing
- name: Run Unit Tests
run: npm test
- name: Run Integration Tests
run: npm run cypress
# TODO: Add upload to dockerhub
# release:
# name: Release
# runs-on: ubuntu-latest
# needs: build
# if: github.ref == 'refs/heads/main'
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - name: Setup Node.js
# uses: actions/setup-node@v2
# with:
# node-version: 14
# cache: 'npm'
# - name: Install dependencies
# run: npm ci
# - name: Create package
# run: npm run build
# - name: Release
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: npx semantic-release