Skip to content

Commit ec80c60

Browse files
committed
Merge branch 'release/5.0.6'
2 parents 93f9355 + f6659e7 commit ec80c60

File tree

132 files changed

+1705
-752
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+1705
-752
lines changed

.github/dependabot.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,28 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "weekly"
7-
day: "friday"
7+
day: "thursday"
88
time: "18:00"
99
timezone: Europe/Paris
10-
open-pull-requests-limit: 10
10+
open-pull-requests-limit: 9
1111
target-branch: development
1212

13-
- package-ecosystem: "npm"
13+
- package-ecosystem: maven
14+
directory: "/"
15+
schedule:
16+
interval: "weekly"
17+
day: "sunday"
18+
time: "18:00"
19+
timezone: Europe/Paris
20+
open-pull-requests-limit: 9
21+
target-branch: development
22+
23+
- package-ecosystem: npm
1424
directory: "/docs"
1525
schedule:
1626
interval: "weekly"
17-
day: "friday"
27+
day: "sunday"
1828
time: "18:00"
1929
timezone: Europe/Paris
20-
open-pull-requests-limit: 10
30+
open-pull-requests-limit: 9
2131
target-branch: development
Lines changed: 14 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,44 @@
1-
name: Continuous integration
1+
name: Branch push or pull request
22

3-
on:
4-
push:
5-
branches:
6-
- "development"
3+
on: [push, pull_request]
74

85
jobs:
96
build:
10-
# ==================================================================================================================
11-
# Configuration.
127
runs-on: ubuntu-latest
138

149
steps:
15-
# ================================================================================================================
16-
- name: GPG Setup
17-
env:
18-
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
19-
run: |
20-
echo "$GPG_PRIVATE_KEY" > private.asc
21-
gpg --import --batch private.asc
22-
2310
# ================================================================================================================
2411
- name: JDK 11 Setup
2512
uses: actions/setup-java@v2
2613
with:
2714
distribution: 'adopt'
2815
java-version: '11'
29-
server-id: ossrh
30-
server-username: MAVEN_USERNAME
31-
server-password: MAVEN_PASSWORD
3216

3317
# ================================================================================================================
3418
- name: Retrieve the sources
3519
uses: actions/checkout@v2
3620

3721
# ================================================================================================================
38-
- name: Build, run tests, package and deploy to Maven central
39-
env: # Environment variables.
40-
# GPG.
41-
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
42-
# OSSRH credentials.
43-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
44-
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
22+
- name: Build, run tests and deploy locally
23+
id: maven
4524
run: |
46-
mvn deploy -B -Dgpg.passphrase=${GPG_PASSPHRASE}
25+
mvn install -Dgpg.skip
26+
echo "::set-output name=version::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
4727
4828
# ================================================================================================================
4929
- name: Upload codacy coverage results
50-
continue-on-error: true
5130
run: |
5231
bash <(curl -Ls https://coverage.codacy.com/get.sh) report \
5332
--project-token ${{ secrets.CODACY_API_TOKEN }} \
5433
-r spring-boot-starter/autoconfigure/target/site/jacoco/jacoco.xml
5534
56-
# ================================================================================================================
57-
- name: Retrieve the version from Maven pom
58-
id: version
59-
run: |
60-
echo "::set-output name=version::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
61-
6235
# ================================================================================================================
6336
- name: Test Cassandre trading bot maven archetype - basic strategy
6437
run: |
6538
mvn -B archetype:generate \
6639
-DarchetypeGroupId=tech.cassandre.trading.bot \
6740
-DarchetypeArtifactId=cassandre-trading-bot-spring-boot-starter-basic-archetype \
68-
-DarchetypeVersion=${{ steps.version.outputs.version }} \
41+
-DarchetypeVersion=${{ steps.maven.outputs.version }} \
6942
-DgroupId=com.example \
7043
-DartifactId=archetype-test-basic \
7144
-Dversion=1.0-SNAPSHOT \
@@ -78,7 +51,7 @@ jobs:
7851
mvn -B archetype:generate \
7952
-DarchetypeGroupId=tech.cassandre.trading.bot \
8053
-DarchetypeArtifactId=cassandre-trading-bot-spring-boot-starter-basic-ta4j-archetype \
81-
-DarchetypeVersion=${{ steps.version.outputs.version }} \
54+
-DarchetypeVersion=${{ steps.maven.outputs.version }} \
8255
-DgroupId=com.example \
8356
-DartifactId=archetype-test-ta4j-basic \
8457
-Dversion=1.0-SNAPSHOT \
@@ -89,22 +62,22 @@ jobs:
8962
# Testing that the graphql starter is working correctly.
9063
- name: Start a postgres server and restore a database from production
9164
run: |
65+
docker pull library/postgres:13-alpine
9266
docker run -d \
9367
--name postgres \
9468
-p 5432:5432 \
9569
-e POSTGRES_DB=cassandre_trading_bot \
9670
-e POSTGRES_USER=cassandre_trading_bot \
9771
-e POSTGRES_PASSWORD=cassandre_trading_bot_password \
72+
-v $(pwd)/util/test/api/graphql/dump_cassandre_trading_bot.sql:/docker-entrypoint-initdb.d/dump_cassandre_trading_bot.sql \
9873
library/postgres:13-alpine
99-
sleep 30
100-
docker exec -i postgres psql -U cassandre_trading_bot cassandre_trading_bot < util/test/api/graphql/dump_cassandre_trading_bot.sql
10174
10275
- name: Creating a trading bot and configure it for the postgres database
10376
run: |
10477
mvn -B archetype:generate \
10578
-DarchetypeGroupId=tech.cassandre.trading.bot \
10679
-DarchetypeArtifactId=cassandre-trading-bot-spring-boot-starter-basic-archetype \
107-
-DarchetypeVersion=${{ steps.version.outputs.version }} \
80+
-DarchetypeVersion=${{ steps.maven.outputs.version }} \
10881
-DgroupId=com.example \
10982
-DartifactId=archetype-test-api-graphql \
11083
-Dversion=1.0-SNAPSHOT \
@@ -114,11 +87,10 @@ jobs:
11487
cp util/test/api/graphql/application.properties archetype-test-api-graphql/src/main/resources/
11588
cp util/test/api/graphql/user-trade.tsv archetype-test-api-graphql/src/main/resources/
11689
mvn -f archetype-test-api-graphql/pom.xml spring-boot:run &
90+
sleep 60
11791
11892
- name: Runs graphQL tests.
11993
run: |
120-
sleep 30
121-
cp util/test/api/graphql/package.json .
122-
cp util/test/api/graphql/*.js .
94+
cd util/test/api/graphql
12395
npm install --save-dev jest isomorphic-fetch
124-
npm run test
96+
npm run test

.github/workflows/branch-push.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
name: "CodeQL"
1+
name: CodeQL analysis
22

33
on:
44
schedule:
5-
- cron: '0 17 * * FRI'
5+
- cron: '0 18 * * THU'
6+
- cron: '0 18 * * SUN'
67

78
jobs:
89
analyze:
9-
# ==================================================================================================================
10-
# Configuration.
11-
name: Analyze
1210
runs-on: ubuntu-latest
1311

1412
steps:
@@ -24,17 +22,16 @@ jobs:
2422
uses: actions/checkout@v2
2523

2624
# ================================================================================================================
27-
# Initializes the CodeQL tools for scanning.
2825
- name: Initialize CodeQL
29-
uses: github/codeql-action/init@v1.0.7
26+
uses: github/codeql-action/init@v1.0.22
3027
with:
3128
languages: java
3229

3330
# ================================================================================================================
34-
- name: Build, run tests and package
31+
- name: Build and package
3532
run: |
36-
mvn package
33+
mvn package -DskipTests
3734
3835
# ================================================================================================================
3936
- name: Perform CodeQL Analysis
40-
uses: github/codeql-action/analyze@v1.0.7
37+
uses: github/codeql-action/analyze@v1.0.22

.github/workflows/integration-tests.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ name: Integration tests
22

33
on:
44
schedule:
5-
- cron: '0 17 * * FRI'
5+
- cron: '0 18 * * THU'
6+
- cron: '0 18 * * SUN'
67

78
jobs:
89
build:
9-
# ==================================================================================================================
10-
# Configuration.
1110
runs-on: ubuntu-latest
1211

1312
steps:
@@ -23,8 +22,8 @@ jobs:
2322
uses: actions/checkout@v2
2423

2524
# ================================================================================================================
26-
- name: Build, run tests, package and deploy to Maven central - Also sends Qase tests reports
27-
env: # Environment variables.
25+
- name: Build and run integration tests
26+
env:
2827
# Kucoin credentials.
2928
KUCOIN_NAME: ${{ secrets.KUCOIN_NAME }}
3029
KUCOIN_USERNAME: ${{ secrets.KUCOIN_USERNAME }}
@@ -50,4 +49,4 @@ jobs:
5049
BINANCE_KEY: ${{ secrets.BINANCE_KEY }}
5150
BINANCE_SECRET: ${{ secrets.BINANCE_SECRET }}
5251
run: |
53-
mvn -Pintegration package
52+
mvn test -Pintegration
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Publish snapshot and website
2+
3+
on:
4+
push:
5+
branches:
6+
- "development"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
# ================================================================================================================
14+
- name: JDK 11 Setup
15+
uses: actions/setup-java@v2
16+
with:
17+
distribution: 'adopt'
18+
java-version: '11'
19+
server-id: ossrh
20+
server-username: MAVEN_USERNAME
21+
server-password: MAVEN_PASSWORD
22+
23+
# ================================================================================================================
24+
- name: Retrieve the sources
25+
uses: actions/checkout@v2
26+
27+
# ================================================================================================================
28+
- name: GPG Setup
29+
env:
30+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
31+
run: |
32+
echo "$GPG_PRIVATE_KEY" > private.asc
33+
gpg --import --batch private.asc
34+
35+
# ================================================================================================================
36+
- name: Build, package and deploy to Maven central
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
# Ossrh credentials.
40+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
41+
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
42+
# GPG.
43+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
44+
run: |
45+
mvn deploy -B -DskipTests=true -Dgpg.passphrase=${GPG_PASSPHRASE}
46+
47+
# ================================================================================================================
48+
- name: Retrieve the latest release published on Github
49+
uses: pozetroninc/github-action-get-latest-release@v0.5.0
50+
id: getLatestRelease
51+
with:
52+
repository: ${{ github.repository }}
53+
54+
# ================================================================================================================
55+
- name: Install Go to generate the graphQL documentation with gqldoc
56+
uses: actions/setup-go@v2
57+
with:
58+
go-version: '^1.17.3'
59+
60+
# ================================================================================================================
61+
- name: Add the GraphQL schema and its documentation to the website
62+
run: |
63+
cp spring-boot-starter-api/spring-boot-starter-api-graphql/autoconfigure/src/main/resources/schema/*.graphqls docs/docs/.vuepress/public/api/graphql/definition
64+
go install github.com/Code-Hex/gqldoc/cmd/gqldoc@v0.0.4
65+
gqldoc -s "docs/docs/.vuepress/public/api/graphql/definition/*.graphqls" -o ./docs/docs/learn/graphql-api-documentation
66+
67+
# ================================================================================================================
68+
- name: Install vuepress, set release number, and build the website
69+
run: |
70+
yarn add -D vuepress@next
71+
find . -type f -name "*.md" -exec sed -i 's/CASSANDRE_LATEST_RELEASE/${{ steps.getLatestRelease.outputs.release }}/g' {} \;
72+
yarn --cwd docs install
73+
yarn --cwd docs docs:build docs
74+
75+
# ================================================================================================================
76+
- name: Deploy the website to github pages
77+
uses: JamesIves/github-pages-deploy-action@4.1.4
78+
with:
79+
branch: gh-pages
80+
folder: docs/docs/.vuepress/dist
81+
commit-message: "Website update"
82+
clean: true

0 commit comments

Comments
 (0)