-
Notifications
You must be signed in to change notification settings - Fork 22
94 lines (76 loc) · 2.75 KB
/
options-tests-with-docker-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
name: Options tests with docker build
on:
schedule:
- cron: "05 09 * * 1"
push:
branches:
- 'integration'
jobs:
build:
if: github.repository == 'veraPDF/veraPDF-rest'
runs-on: ubuntu-latest
steps:
- name: Checkout the branch
uses: actions/checkout@v3
- name: Build and run Docker Image
run: |
docker build --build-arg GH_CHECKOUT=integration -t rest:dev . && docker run --user root -d -p 8080:8080 -p 8081:8081 -e VERAPDF_MAX_FILE_SIZE=1 -v /tmp:/home/Res_tmp rest:dev
echo whoami: $(docker inspect $(docker ps -q) --format '{{.Config.User}} {{.Name}}')
- name: Check Docker Container
run: |
docker images
docker ps
- name: Preparing Linux packages(Bats-core and more ...)
if: runner.os == 'Linux'
working-directory: ./tests
run: |
echo whoami: $(whoami)
mkdir ./results
sudo apt-get update -y
sudo apt install git -y
sudo apt-get install python3 -y
sudo apt-get install python3-pip -y
sudo pip install junit2html
echo $(pip list)
git --version
echo "Adding: bats-core.git, bats-support.git and bats-assert.git"
git clone https://github.com/bats-core/bats-core.git ./bats
git clone https://github.com/bats-core/bats-support.git ./bats-support
git clone https://github.com/bats-core/bats-assert.git ./bats-assert
./bats/bin/bats -v
- name: Running tests ... Options
working-directory: ./tests
run: |
echo pwd: $PWD
echo dir: $(ls ./)
./bats/bin/bats -r ./Options --show-output-of-passing-tests --print-output-on-failure --report-formatter junit --output ./results
- name: Generating report
if: always()
working-directory: ./tests/results
run: |
echo pwd: $PWD
junit2html report.xml --report-matrix report.html
- name: Uploading report
uses: actions/upload-artifact@v1
if: success() || failure()
with:
name: Results
path: "./tests/results"
- name: Notify slack tests succeeded
if: success()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel_id: C03E3JJGLQL
status: SUCCESS
color: good
- name: Notify slack tests failed
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel_id: C03E3JJGLQL
status: FAILED
color: danger