This repository was archived by the owner on Apr 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
137 lines (137 loc) · 4.28 KB
/
update.yml
File metadata and controls
137 lines (137 loc) · 4.28 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
on: [workflow_dispatch]
name: Update dependencies
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: update dependencies
run: mvn versions:use-latest-versions
- name: fail if there are no dependency updates
run: "! git diff --exit-code"
test:
strategy:
max-parallel: 1
runs-on: ubuntu-latest
needs: update
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: update dependencies
run: mvn versions:use-latest-versions
- name: "setup files"
run: |
echo "jda-factory-class=io.github.jdiscordbots.nightdream.JDALoader" > $propFile;
echo "jda-factory-method=load" >> $propFile
echo "testing-prefix=nt." >> $propFile
echo "testing-channel=$testChan" >> $propFile
mkdir test
echo "prefix=nt." >> test/Guild.properties
echo "KSoftToken=$kSoftToken" >> test/NightDream.properties
echo "PixabayAPIKey=$pixabayAPIKey" >> test/NightDream.properties
env:
testChan: ${{ secrets.testingChannel }}
propFile: src/test/resources/jda-tests.properties
kSoftToken: ${{ secrets.ksoftToken }}
pixabayAPIKey: ${{ secrets.pixabayAPIKey }}
- name: "automated (feature) tests"
run: "mvn -B test"
env:
ND_token: ${{secrets.botToken}}
ND_admin: ${{ secrets.botAdmin }}
ND_testuser: ${{secrets.testUser}}
Spotbugs:
runs-on: ubuntu-latest
needs: update
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: update dependencies
run: mvn versions:use-latest-versions
- name: run Spotbugs analysis
run: mvn spotbugs:check
check-notice:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: "check notice"
run: mvn -B notice:check
commit:
runs-on: ubuntu-latest
needs: [test,check-notice]
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: update dependencies
run: mvn versions:use-latest-versions
- name: "setup git"
run: |
git remote add github https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git
git pull github ${GITHUB_REF} --ff-only
git config --global user.name "github-actions-bot"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: commit
run: |
git add pom.xml
git commit -m "update dependencies"
- name: push
run: git push github HEAD:${GITHUB_REF}
SonarCloud:
needs: commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: compile
run: mvn verify -DskipTests=true
- name: Run sonarqube
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn sonar:sonar "-Dsonar.login=$SONAR_TOKEN"
-Dsonar.host.url=https://sonarcloud.io/
upload:
runs-on: ubuntu-latest
needs: commit
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: update dependencies
run: mvn versions:use-latest-versions
- name: "setup user info"
run: |
git config --global user.name "github-actions-bot"
- name: "clone Wiki"
run: git clone https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY.wiki.git wiki
- name: "create JAR and copy it to the wiki"
run: |
mvn package -DskipTests=true -Dexternalversion="$(git describe --tags --always --dirty=-modified)"
cp target/NightDream.jar wiki/NightDream.jar
- name: "Upload to wiki"
run: |
cd wiki
git add NightDream.jar
git commit --amend -m "CI JAR deploy: $(date)"
git push --force-with-lease
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}