Skip to content

Commit

Permalink
issues/245 - Apply Carl's patch for github action workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
meywood committed Feb 13, 2024
1 parent 44ce981 commit 0e85b2d
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 158 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/generate-jekyll-pages-for-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: generate-jekyll-pages-for-docs

on:
workflow_run:
workflows: [ update-gh-pages ]
workflows: [ test-and-build ]
branches: [ main ]
types: [ completed ]

Expand All @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4.1.1
with:
ref: gh-pages
fetch-depth: 0
Expand All @@ -24,4 +24,4 @@ jobs:
SOURCE_INDEX_FILE: README.md

- name: Commit changes
uses: EndBug/add-and-commit@v8.0.1
uses: EndBug/add-and-commit@v9.1.4
10 changes: 5 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4.1.1

- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
Expand All @@ -27,15 +27,15 @@ jobs:
run: chmod +x gradlew

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v2.1.0

- name: Publish package
uses: gradle/gradle-build-action@v2
uses: gradle/gradle-build-action@v3
with:
arguments: publish closeAndReleaseStagingRepository
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GPG_SIGNING_KEY_PASSWORD: ${{ secrets.GPG_SIGNING_KEY_PASSWORD }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Java CI with Gradle
name: Java SDK test and build

on:
push:
Expand All @@ -12,45 +12,32 @@ on:

jobs:
build:
name: Build and test SDK
runs-on: ubuntu-latest
services:
nctl:
image: stormeye2000/cspr-nctl:1.5
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
uses: actions/checkout@v4.1.1

- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v4
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
# Start NCTL and copy assests over
- name: Start NCTL and copy assests over
run: |
cd sh && chmod +x docker-copy-assets.sh && ./docker-copy-assets.sh && cd ..
./gradlew clean build
cd script && chmod +x docker-run && ./docker-run
sleep 30
chmod +x docker-copy-assets && ./docker-copy-assets && cd ..
- name: Run the unit tests
run: ./gradlew clean build

- name: Export project version
run: echo "PROJECT_VERSION=$(./gradlew properties -q | grep "version:" | awk '{print $2}')" >> $GITHUB_ENV
Expand All @@ -67,39 +54,39 @@ jobs:
target-folder: docs/latest/junit

- name: Deploy jacoco report to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.2.2
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
branch: gh-pages
clean: true
folder: build/reports/jacoco
target-folder: docs/latest/jacoco

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.2.2
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
branch: gh-pages
clean: true
folder: build/docs/javadoc
target-folder: docs/latest/javadoc

- name: Deploy tests results to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.2.2
uses: JamesIves/github-pages-deploy-action@v4.5.0
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/github-pages-deploy-action@v4.2.2
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
branch: gh-pages
clean: true
folder: build/reports/jacoco
target-folder: docs/${{ env.PROJECT_VERSION }}/jacoco

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.2.2
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
branch: gh-pages
clean: true
Expand Down
113 changes: 0 additions & 113 deletions .github/workflows/update-gh-pages.yml

This file was deleted.

11 changes: 11 additions & 0 deletions script/docker-copy-assets
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
BASEDIR=$(builtin cd .. || exit 1; pwd)
# clear the assets folder
rm -rf "${BASEDIR}/assets"
mkdir "${BASEDIR}/assets"
# copy net-1 users
docker cp cspr-nctl:/home/casper/casper-node/utils/nctl/assets/net-1/users "${BASEDIR}/assets/net-1"
# copy net-1 chainspec
docker cp cspr-nctl:/home/casper/casper-node/utils/nctl/assets/net-1/chainspec "${BASEDIR}/assets/net-1"
# copy faucet keys
docker cp cspr-nctl:/home/casper/casper-node/utils/nctl/assets/net-1/faucet "${BASEDIR}/assets/net-1"
3 changes: 3 additions & 0 deletions script/docker-run
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
# run the cspr-nctl container in docker
docker run --rm -it --name cspr-nctl -d -p 25101:25101 -p 11101:11101 -p 14101:14101 -p 18101:18101 stormeye2000/cspr-nctl:linux-1.5.5
6 changes: 0 additions & 6 deletions sh/docker-copy-assets.sh

This file was deleted.

0 comments on commit 0e85b2d

Please sign in to comment.