Skip to content

Commit 667567a

Browse files
authored
Merge pull request #597 from adamretter/ci
Move Travis CI to GitHub Actions
2 parents 576c9bb + 47d1b3c commit 667567a

File tree

7 files changed

+161
-65
lines changed

7 files changed

+161
-65
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI
2+
on: [push, pull_request]
3+
jobs:
4+
build:
5+
name: Build and Test (${{ matrix.os }} / OpenJDK ${{ matrix.jdk }})
6+
strategy:
7+
fail-fast: true
8+
matrix:
9+
jdk: ['8', '11']
10+
os: [ubuntu-latest]
11+
runs-on: ${{ matrix.os }}
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up JDK ${{ matrix.jdk }}
15+
uses: actions/setup-java@v1
16+
with:
17+
java-version: ${{ matrix.jdk }}
18+
- name: Cache Maven packages
19+
uses: actions/cache@v2
20+
with:
21+
path: ~/.m2
22+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
23+
restore-keys: ${{ runner.os }}-m2
24+
- name: Maven Build
25+
run: mvn clean package -DskipTests
26+
- name: Test
27+
env:
28+
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
29+
run: mvn verify

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ node/*
1010

1111
maven-archiver/
1212

13+
.DS_Store
14+
1315
src/test/cypress/videos/*.mp4
1416
src/test/cypress/screenshots/**/*.png

.travis.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# eXist-db Documentation
2-
[![Build Status](https://travis-ci.com/eXist-db/documentation.svg?branch=master)](https://travis-ci.com/eXist-db/documentation)
2+
[![Build Status](https://github.com/eXist-db/documentation/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/eXist-db/documentation/actions/workflows/ci.yml)
33
[![Docbook version](https://img.shields.io/badge/docbook-5.1-19a5a4.svg)](http://docbook.org/xml/5.1/)
44
[![eXist-db version](https://img.shields.io/badge/eXist_db-5.2.0-blue.svg)](http://www.exist-db.org/exist/apps/homepage/index.html)
55

cypress.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
"screenshotsFolder": "src/test/cypress/screenshots",
1010
"supportFile": "src/test/cypress/support/index.js",
1111
"videosFolder": "src/test/cypress/videos",
12-
"projectId": "h8zx19"
12+
"projectId": "wgr8uu"
1313
}

pom.xml

Lines changed: 128 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@
9696
</resource>
9797
</resources>
9898

99+
<pluginManagement>
100+
<plugins>
101+
<plugin>
102+
<groupId>org.codehaus.mojo</groupId>
103+
<artifactId>exec-maven-plugin</artifactId>
104+
<version>3.0.0</version>
105+
</plugin>
106+
</plugins>
107+
</pluginManagement>
108+
99109
<plugins>
100110
<plugin>
101111
<groupId>com.github.eirslett</groupId>
@@ -139,12 +149,13 @@
139149
</goals>
140150
<phase>compile</phase>
141151
</execution>
152+
<!-- Mocha is used for integration tests of xqsuite -->
142153
<execution>
143154
<id>mocha tests</id>
144155
<goals>
145156
<goal>npm</goal>
146157
</goals>
147-
<phase>test</phase>
158+
<phase>integration-test</phase>
148159
<configuration>
149160
<arguments>test</arguments>
150161
</configuration>
@@ -238,6 +249,46 @@
238249
</execution>
239250
</executions>
240251
</plugin>
252+
<!-- start up Server in Docker for integration-test -->
253+
<plugin>
254+
<groupId>io.fabric8</groupId>
255+
<artifactId>docker-maven-plugin</artifactId>
256+
<version>0.35.0</version>
257+
<configuration>
258+
<verbose>true</verbose>
259+
<images>
260+
<image>
261+
<alias>existdb-docs-tests</alias>
262+
<name>existdb/existdb:latest</name>
263+
<run>
264+
<ports>
265+
<port>8080:8080</port>
266+
</ports>
267+
<wait>
268+
<log>Server has started, listening on</log>
269+
<time>120000</time>
270+
</wait>
271+
</run>
272+
</image>
273+
</images>
274+
</configuration>
275+
<executions>
276+
<execution>
277+
<id>docker-it-start</id>
278+
<phase>pre-integration-test</phase>
279+
<goals>
280+
<goal>start</goal>
281+
</goals>
282+
</execution>
283+
<execution>
284+
<id>docker-it-stop</id>
285+
<phase>post-integration-test</phase>
286+
<goals>
287+
<goal>stop</goal>
288+
</goals>
289+
</execution>
290+
</executions>
291+
</plugin>
241292
<plugin>
242293
<groupId>org.apache.maven.plugins</groupId>
243294
<artifactId>maven-gpg-plugin</artifactId>
@@ -259,17 +310,87 @@
259310
</plugins>
260311
</build>
261312

262-
<repositories>
263-
<repository>
264-
<id>exist</id>
265-
<url>https://raw.github.com/eXist-db/mvn-repo/master/</url>
266-
</repository>
267-
</repositories>
313+
<!--
314+
Cypress is used for integration tests
315+
316+
First profile enables to run Cypress without record (cypress.io) support.
317+
Second profile enables to run Cypress with record support, e.g. for CI.
318+
-->
319+
<profiles>
320+
<profile>
321+
<id>cypress-without-record</id>
322+
<activation>
323+
<property>
324+
<name>env.CI</name>
325+
<value>!true</value>
326+
</property>
327+
</activation>
328+
<build>
329+
<plugins>
330+
<plugin>
331+
<groupId>org.codehaus.mojo</groupId>
332+
<artifactId>exec-maven-plugin</artifactId>
333+
<executions>
334+
<execution>
335+
<phase>integration-test</phase>
336+
<goals>
337+
<goal>exec</goal>
338+
</goals>
339+
<configuration>
340+
<executable>npm</executable>
341+
<arguments>
342+
<argument>run</argument>
343+
<argument>cypress</argument>
344+
<argument>--</argument>
345+
</arguments>
346+
</configuration>
347+
</execution>
348+
</executions>
349+
</plugin>
350+
</plugins>
351+
</build>
352+
</profile>
353+
<profile>
354+
<id>cypress-with-record</id>
355+
<activation>
356+
<property>
357+
<name>env.CI</name>
358+
<value>true</value>
359+
</property>
360+
</activation>
361+
<build>
362+
<plugins>
363+
<plugin>
364+
<groupId>org.codehaus.mojo</groupId>
365+
<artifactId>exec-maven-plugin</artifactId>
366+
<executions>
367+
<execution>
368+
<phase>integration-test</phase>
369+
<goals>
370+
<goal>exec</goal>
371+
</goals>
372+
<configuration>
373+
<executable>npm</executable>
374+
<arguments>
375+
<argument>run</argument>
376+
<argument>cypress</argument>
377+
<argument>--</argument>
378+
<argument>--record</argument>
379+
</arguments>
380+
</configuration>
381+
</execution>
382+
</executions>
383+
</plugin>
384+
</plugins>
385+
</build>
386+
</profile>
387+
</profiles>
268388

269389
<pluginRepositories>
270390
<pluginRepository>
271391
<id>clojars.org</id>
272392
<url>http://clojars.org/repo</url>
273393
</pluginRepository>
274394
</pluginRepositories>
395+
275396
</project>

src/test/mocha/test.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)