Skip to content

Commit

Permalink
Merge branch 'release/5.0.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
straumat committed Nov 25, 2021
2 parents 93f9355 + f6659e7 commit ec80c60
Show file tree
Hide file tree
Showing 132 changed files with 1,705 additions and 752 deletions.
20 changes: 15 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,28 @@ updates:
directory: "/"
schedule:
interval: "weekly"
day: "friday"
day: "thursday"
time: "18:00"
timezone: Europe/Paris
open-pull-requests-limit: 10
open-pull-requests-limit: 9
target-branch: development

- package-ecosystem: "npm"
- package-ecosystem: maven
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
time: "18:00"
timezone: Europe/Paris
open-pull-requests-limit: 9
target-branch: development

- package-ecosystem: npm
directory: "/docs"
schedule:
interval: "weekly"
day: "friday"
day: "sunday"
time: "18:00"
timezone: Europe/Paris
open-pull-requests-limit: 10
open-pull-requests-limit: 9
target-branch: development
Original file line number Diff line number Diff line change
@@ -1,71 +1,44 @@
name: Continuous integration
name: Branch push or pull request

on:
push:
branches:
- "development"
on: [push, pull_request]

jobs:
build:
# ==================================================================================================================
# Configuration.
runs-on: ubuntu-latest

steps:
# ================================================================================================================
- name: GPG Setup
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
run: |
echo "$GPG_PRIVATE_KEY" > private.asc
gpg --import --batch private.asc
# ================================================================================================================
- name: JDK 11 Setup
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

# ================================================================================================================
- name: Retrieve the sources
uses: actions/checkout@v2

# ================================================================================================================
- name: Build, run tests, package and deploy to Maven central
env: # Environment variables.
# GPG.
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
# OSSRH credentials.
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
- name: Build, run tests and deploy locally
id: maven
run: |
mvn deploy -B -Dgpg.passphrase=${GPG_PASSPHRASE}
mvn install -Dgpg.skip
echo "::set-output name=version::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
# ================================================================================================================
- name: Upload codacy coverage results
continue-on-error: true
run: |
bash <(curl -Ls https://coverage.codacy.com/get.sh) report \
--project-token ${{ secrets.CODACY_API_TOKEN }} \
-r spring-boot-starter/autoconfigure/target/site/jacoco/jacoco.xml
# ================================================================================================================
- name: Retrieve the version from Maven pom
id: version
run: |
echo "::set-output name=version::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
# ================================================================================================================
- name: Test Cassandre trading bot maven archetype - basic strategy
run: |
mvn -B archetype:generate \
-DarchetypeGroupId=tech.cassandre.trading.bot \
-DarchetypeArtifactId=cassandre-trading-bot-spring-boot-starter-basic-archetype \
-DarchetypeVersion=${{ steps.version.outputs.version }} \
-DarchetypeVersion=${{ steps.maven.outputs.version }} \
-DgroupId=com.example \
-DartifactId=archetype-test-basic \
-Dversion=1.0-SNAPSHOT \
Expand All @@ -78,7 +51,7 @@ jobs:
mvn -B archetype:generate \
-DarchetypeGroupId=tech.cassandre.trading.bot \
-DarchetypeArtifactId=cassandre-trading-bot-spring-boot-starter-basic-ta4j-archetype \
-DarchetypeVersion=${{ steps.version.outputs.version }} \
-DarchetypeVersion=${{ steps.maven.outputs.version }} \
-DgroupId=com.example \
-DartifactId=archetype-test-ta4j-basic \
-Dversion=1.0-SNAPSHOT \
Expand All @@ -89,22 +62,22 @@ jobs:
# Testing that the graphql starter is working correctly.
- name: Start a postgres server and restore a database from production
run: |
docker pull library/postgres:13-alpine
docker run -d \
--name postgres \
-p 5432:5432 \
-e POSTGRES_DB=cassandre_trading_bot \
-e POSTGRES_USER=cassandre_trading_bot \
-e POSTGRES_PASSWORD=cassandre_trading_bot_password \
-v $(pwd)/util/test/api/graphql/dump_cassandre_trading_bot.sql:/docker-entrypoint-initdb.d/dump_cassandre_trading_bot.sql \
library/postgres:13-alpine
sleep 30
docker exec -i postgres psql -U cassandre_trading_bot cassandre_trading_bot < util/test/api/graphql/dump_cassandre_trading_bot.sql
- name: Creating a trading bot and configure it for the postgres database
run: |
mvn -B archetype:generate \
-DarchetypeGroupId=tech.cassandre.trading.bot \
-DarchetypeArtifactId=cassandre-trading-bot-spring-boot-starter-basic-archetype \
-DarchetypeVersion=${{ steps.version.outputs.version }} \
-DarchetypeVersion=${{ steps.maven.outputs.version }} \
-DgroupId=com.example \
-DartifactId=archetype-test-api-graphql \
-Dversion=1.0-SNAPSHOT \
Expand All @@ -114,11 +87,10 @@ jobs:
cp util/test/api/graphql/application.properties archetype-test-api-graphql/src/main/resources/
cp util/test/api/graphql/user-trade.tsv archetype-test-api-graphql/src/main/resources/
mvn -f archetype-test-api-graphql/pom.xml spring-boot:run &
sleep 60
- name: Runs graphQL tests.
run: |
sleep 30
cp util/test/api/graphql/package.json .
cp util/test/api/graphql/*.js .
cd util/test/api/graphql
npm install --save-dev jest isomorphic-fetch
npm run test
npm run test
63 changes: 0 additions & 63 deletions .github/workflows/branch-push.yml

This file was deleted.

17 changes: 7 additions & 10 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
name: "CodeQL"
name: CodeQL analysis

on:
schedule:
- cron: '0 17 * * FRI'
- cron: '0 18 * * THU'
- cron: '0 18 * * SUN'

jobs:
analyze:
# ==================================================================================================================
# Configuration.
name: Analyze
runs-on: ubuntu-latest

steps:
Expand All @@ -24,17 +22,16 @@ jobs:
uses: actions/checkout@v2

# ================================================================================================================
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1.0.7
uses: github/codeql-action/init@v1.0.22
with:
languages: java

# ================================================================================================================
- name: Build, run tests and package
- name: Build and package
run: |
mvn package
mvn package -DskipTests
# ================================================================================================================
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1.0.7
uses: github/codeql-action/analyze@v1.0.22
11 changes: 5 additions & 6 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ name: Integration tests

on:
schedule:
- cron: '0 17 * * FRI'
- cron: '0 18 * * THU'
- cron: '0 18 * * SUN'

jobs:
build:
# ==================================================================================================================
# Configuration.
runs-on: ubuntu-latest

steps:
Expand All @@ -23,8 +22,8 @@ jobs:
uses: actions/checkout@v2

# ================================================================================================================
- name: Build, run tests, package and deploy to Maven central - Also sends Qase tests reports
env: # Environment variables.
- name: Build and run integration tests
env:
# Kucoin credentials.
KUCOIN_NAME: ${{ secrets.KUCOIN_NAME }}
KUCOIN_USERNAME: ${{ secrets.KUCOIN_USERNAME }}
Expand All @@ -50,4 +49,4 @@ jobs:
BINANCE_KEY: ${{ secrets.BINANCE_KEY }}
BINANCE_SECRET: ${{ secrets.BINANCE_SECRET }}
run: |
mvn -Pintegration package
mvn test -Pintegration
82 changes: 82 additions & 0 deletions .github/workflows/publish-snapshot-and-website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Publish snapshot and website

on:
push:
branches:
- "development"

jobs:
build:
runs-on: ubuntu-latest

steps:
# ================================================================================================================
- name: JDK 11 Setup
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

# ================================================================================================================
- name: Retrieve the sources
uses: actions/checkout@v2

# ================================================================================================================
- name: GPG Setup
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
run: |
echo "$GPG_PRIVATE_KEY" > private.asc
gpg --import --batch private.asc
# ================================================================================================================
- name: Build, package and deploy to Maven central
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Ossrh credentials.
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
# GPG.
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
mvn deploy -B -DskipTests=true -Dgpg.passphrase=${GPG_PASSPHRASE}
# ================================================================================================================
- name: Retrieve the latest release published on Github
uses: pozetroninc/github-action-get-latest-release@v0.5.0
id: getLatestRelease
with:
repository: ${{ github.repository }}

# ================================================================================================================
- name: Install Go to generate the graphQL documentation with gqldoc
uses: actions/setup-go@v2
with:
go-version: '^1.17.3'

# ================================================================================================================
- name: Add the GraphQL schema and its documentation to the website
run: |
cp spring-boot-starter-api/spring-boot-starter-api-graphql/autoconfigure/src/main/resources/schema/*.graphqls docs/docs/.vuepress/public/api/graphql/definition
go install github.com/Code-Hex/gqldoc/cmd/gqldoc@v0.0.4
gqldoc -s "docs/docs/.vuepress/public/api/graphql/definition/*.graphqls" -o ./docs/docs/learn/graphql-api-documentation
# ================================================================================================================
- name: Install vuepress, set release number, and build the website
run: |
yarn add -D vuepress@next
find . -type f -name "*.md" -exec sed -i 's/CASSANDRE_LATEST_RELEASE/${{ steps.getLatestRelease.outputs.release }}/g' {} \;
yarn --cwd docs install
yarn --cwd docs docs:build docs
# ================================================================================================================
- name: Deploy the website to github pages
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
branch: gh-pages
folder: docs/docs/.vuepress/dist
commit-message: "Website update"
clean: true

0 comments on commit ec80c60

Please sign in to comment.