Issues/225 - Refactor with more meaningful steps #200
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a Java project with Gradle and run e2e cucumber tests | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | |
name: Java CI with Gradle | |
on: | |
push: | |
branches: [main, dev] | |
pull_request: | |
branches: [main, dev] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
nctl: | |
image: stormeye2000/cspr-nctl:linux-1.5.2 | |
options: --name cspr-nctl | |
env: | |
PREDEFINED_ACCOUNTS: 'true' | |
MINIMUM_ROUND_EXPONENT: '12' | |
MAXIMUM_ROUND_EXPONENT: '14' | |
DEPLOY_DELAY: '30sec' | |
SPECULATIVE_EXEC_SERVER_ENABLED: 'true' | |
ports: | |
- 11101:11101 | |
- 14101:14101 | |
- 18101:18101 | |
- 25101:25101 | |
steps: | |
- name: Wait for NCTL | |
run: | | |
echo "Wait for NCTL" | |
sleep 30s | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
# Copy the assets from the NCTL docker image and build | |
- name: Build and test with Gradle | |
run: | | |
cd script && chmod +x docker-copy-assets && ./docker-copy-assets && cd .. | |
./gradlew clean build | |
- name: Export project version | |
run: echo "PROJECT_VERSION=$(./gradlew properties -q | grep "version:" | awk '{print $2}')" >> $GITHUB_ENV | |
- name: Export Cspr Node Version | |
run: echo "CSRP_NODE_VERSION=$(./gradlew properties -q | grep "csprNodeVersion:" | awk '{print $2}')" >> $GITHUB_ENV | |
- name: Generate Javadoc | |
run: ./gradlew javadoc | |
- name: Deploy tests results to GitHub Pages | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
clean: true | |
folder: build/reports/tests | |
target-folder: docs/latest/junit | |
- name: Deploy jacoco report to GitHub Pages | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
clean: true | |
folder: build/reports/jacoco | |
target-folder: docs/latest/jacoco | |
# Runs all the e2e cucumber tests against the docker container cspr-nctl | |
- name: e2e tests | |
run: ./script/e2e-test | |
continue-on-error: true | |
- name: Deploy to GitHub Pages | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
clean: true | |
folder: build/docs/javadoc | |
target-folder: docs/latest/javadoc | |
- name: Deploy tests results to GitHub Pages | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
clean: true | |
folder: build/reports/tests | |
target-folder: docs/${{ env.PROJECT_VERSION }}/junit | |
- name: Deploy jacoco report to GitHub Pages | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
clean: true | |
folder: build/reports/jacoco | |
target-folder: docs/${{ env.PROJECT_VERSION }}/jacoco | |
- name: Deploy to GitHub Pages | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
clean: true | |
folder: build/docs/javadoc | |
target-folder: docs/${{ env.PROJECT_VERSION }}/javadoc | |
- name: Publish e2e tests | |
uses: deblockt/[email protected] | |
with: | |
access-token: ${{ secrets.GITHUB_TOKEN }} | |
path: "**/cucumber-report.json" |