-
Notifications
You must be signed in to change notification settings - Fork 13
111 lines (92 loc) · 4.89 KB
/
build.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Build
on:
push:
branches: [main, '*-development']
pull_request:
branches: [main, '*-development']
jobs:
build:
runs-on: ubuntu-latest
services:
redis:
image: redis:6
ports:
- 46380:6379
fedora:
image: fcrepo/fcrepo:5.1.1
ports:
- 48085:8080
volumes:
- ${{ github.workspace }}/it_config:/config
- /tmp/boxc_test_storage:/tmp/boxc_test_storage
env:
CATALINA_OPTS: "-Djava.awt.headless=true -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -Dfcrepo.external.content.allowed=/config/allowed_external_paths.txt"
steps:
- name: Change permissions of /tmp/boxc_test_storage
run: sudo chmod 2777 /tmp/boxc_test_storage
- name: Checkout repository
uses: actions/checkout@v2
- name: Get Container ID of fedora service
id: get_container_id
run: |
CONTAINER_ID=$(docker ps --format "{{.ID}}" -f "ancestor=fcrepo/fcrepo:5.1.1")
echo "CONTAINER_ID=$CONTAINER_ID" >> $GITHUB_ENV
- name: Restart fedora now that the repository has been checked out so config files are available
run: docker restart ${{ env.CONTAINER_ID }}
- name: Run Fuseki container as command to pass in extra dataset name argument
run: |
docker run -d --rm -p 43030:3030 atomgraph/fuseki --mem /test
- name: Make directory for solr config
run: mkdir -p /tmp/solr-config
# Need to copy the config is outside of the source path, otherwise it produces permission conflicts
- name: Copy Solr Config into container
run: sudo cp -r ${{ github.workspace }}/etc/solr-config/* /tmp/solr-config/
- name: Run solr container as command to trigger core creation
run: |
docker run -v /tmp/solr-config:/solr_config -d --rm -p 48983:8983 solr:9 solr-precreate access /solr_config/access
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: mvn -B -U -pl '!integration' clean install -DskipTests
- name: Set up nodejs
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Cache npm modules
uses: actions/cache@v2
with:
path: ~/.npm
key: v1-npm-deps-${{ hashFiles('**/package-lock.json') }}
restore-keys: v1-npm-deps-
- run: npm --prefix static/js/vue-cdr-access install
- run: npm --prefix static/js/admin/vue-permissions-editor install
- run: npm install -g [email protected]
- run: npm --prefix static/js/vue-cdr-access run test
- run: npm --prefix static/js/admin/vue-permissions-editor run test
- name: Report to CodeClimate
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
JACOCO_SOURCE_PATH: "${{github.workspace}}/auth-api/src/main/java ${{github.workspace}}/auth-fcrepo/src/main/java ${{github.workspace}}/common-utils/src/main/java ${{github.workspace}}/deposit-app/src/main/java ${{github.workspace}}/deposit-utils/src/main/java ${{github.workspace}}/fcrepo-utils/src/main/java ${{github.workspace}}/indexing-solr/src/main/java ${{github.workspace}}/integration/src/main/java ${{github.workspace}}/model-api/src/main/java ${{github.workspace}}/model-fcrepo/src/main/java ${{github.workspace}}/operations/src/main/java ${{github.workspace}}/operations-jms/src/main/java ${{github.workspace}}/persistence/src/main/java ${{github.workspace}}/persistence-api/src/main/java ${{github.workspace}}/search-api/src/main/java ${{github.workspace}}/search-solr/src/main/java ${{github.workspace}}/services-camel-app/src/main/java ${{github.workspace}}/web-access-app/src/main/java ${{github.workspace}}/web-access-war/src/main/java ${{github.workspace}}/web-admin-app/src/main/java ${{github.workspace}}/web-common/src/main/java ${{github.workspace}}/web-services-app/src/main/java ${{github.workspace}}/web-sword/src/main/java ${{github.workspace}}/clamav-java/src/main/java"
with:
coverageCommand: mvn -pl !clamav-java verify
coverageLocations: |
${{github.workspace}}/**/target/site/jacoco/jacoco.xml:jacoco
${{github.workspace}}/**/target/site/jacoco-it/jacoco.xml:jacoco
${{github.workspace}}/static/js/vue-cdr-access/coverage/lcov.info:lcov
${{github.workspace}}/static/js/admin/vue-permissions-editor/coverage/lcov.info:lcov
- name: View fedora service logs
if: always()
run: |
docker logs ${{ env.CONTAINER_ID }}