-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (52 loc) · 2.27 KB
/
test.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
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Run Tests on Docker
on:
push:
branches: [ "main", "renovate/**" ]
pull_request:
branches: [ "main" ]
jobs:
docker-java-test:
runs-on: ubuntu-latest
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
steps:
- name: free disk space
run: |
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
docker rmi $(docker image ls -aq)
df -h
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Grant execute permission for mvnw
run: chmod +x mvnw
# In this step, this action saves a list of existing images,
# the cache is created without them in the post run.
# It also restores the cache if it exists.
- uses: jpribyl/[email protected]
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true
- name: Login to DockerHub
run: docker login -u $DOCKER_USER -p $DOCKER_PASS
- name: Build docker image
run: docker compose -f 'docker/docker-compose.base.yml' -f 'docker/docker-compose.test-all.yml' build
- name: Run tests in docker container
run: docker compose -f 'docker/docker-compose.base.yml' -f 'docker/docker-compose.test-all.yml' up --exit-code-from base
# - name: Setup Java JDK
# uses: actions/setup-java@v3
# with:
# # The Java version to make available on the path. Takes a whole or semver Java version, or 1.x syntax (e.g. 1.8 => Java 8.x). Early access versions can be specified in the form of e.g. 14-ea, 14.0.0-ea, or 14.0.0-ea.28
# distribution: 'temurin' # See 'Supported distributions' for available options
# java-version: '17'
# - name: Run mvn verify
# run: ./mvnw clean verify # -pl vvd-common,vvd-commonkt,vvd-taskproducer,vvd-downloader