-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.travis.yml
97 lines (92 loc) · 2.94 KB
/
.travis.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
language: php
env:
global:
- CORE_BRANCH=stable20
- APP_NAME=ransomware_detection
- KRANKERL_VERSION=0.12.3
services:
- mysql
- postgresql
before_install:
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
- . ./before_install.sh $APP_NAME $CORE_BRANCH $DB
- cd ../server
- ./occ check
- ./occ status
- ./occ app:enable $APP_NAME
- ./occ app:list
- composer install
jobs:
fast_finish: true
allow_failures:
- env: "CHECKSTYLE=2"
include:
- stage: test
php: 7.3
env:
- DB=mysql
script:
- cd apps/$APP_NAME/
- phpunit --configuration phpunit.xml
- stage: test
php: 7.3
env:
- DB=pgsql
script:
- cd apps/$APP_NAME/
- phpunit --configuration phpunit.xml
- stage: test
php: 7.3
env:
- DB=mysql
script:
- cd apps/$APP_NAME/
- phpunit --configuration phpunit.xml
- stage: test
php: 7.3
env:
- DB=mysql
- CHECKSTYLE=1
script:
- ./occ app:check-code $APP_NAME -c private -c strong-comparison
- stage: test
php: 7.3
env:
- DB=mysql
- CHECKSTYLE=2
script:
- ./occ app:check-code $APP_NAME -c deprecation
- stage: report
php: 7.3
env:
- DB=sqlite
script:
- cd tests
- wget https://codecov.io/bash -O codecov.sh
- bash codecov.sh
- stage: release
php: 7.3
env:
- DB=sqlite
script:
- mkdir -p $HOME/.nextcloud/certificates
- curl --output $HOME/.nextcloud/certificates/ransomware_detection.crt -L https://raw.githubusercontent.com/nextcloud/app-certificate-requests/master/ransomware_detection/ransomware_detection.crt
- echo $PRIVATE_KEY > $HOME/.nextcloud/certificates/ransomware_detection.key
- wget https://github.com/ChristophWurst/krankerl/releases/download/v${KRANKERL_VERSION}/krankerl_${KRANKERL_VERSION}_amd64.deb
- sudo dpkg -i krankerl_${KRANKERL_VERSION}_amd64.deb
- sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
- sudo apt-add-repository https://cli.github.com/packages
- sudo apt update
- sudo apt install gh
- ./occ integrity:sign-app --privateKey="$HOME/.nextcloud/certificates/ransomware_detection.key" --certificate="$HOME/.nextcloud/certificates/ransomware_detection.crt" --path="$(pwd)/apps/$APP_NAME"
- cd apps/$APP_NAME/
- krankerl package
- gh auth login --with-token <<< $GITHUB_TOKEN
- gh release create $TRAVIS_TAG build/artifacts/ransomware_detection.tar.gz -t $TRAVIS_TAG
- krankerl login --appstore $NEXTCLOUD_APPS_TOKEN
- krankerl publish https://github.com/undo-ransomware/ransomware_detection/releases/download/$TRAVIS_TAG/ransomware_detection.tar.gz
stages:
- test
- report
- name: release
if: tag IS present