Skip to content

Commit

Permalink
refactor(ci): rearrange jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajpiar committed Jun 12, 2024
1 parent e9b0c78 commit 862d615
Showing 1 changed file with 76 additions and 72 deletions.
148 changes: 76 additions & 72 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
name: Build and Test

on:
push:
branches:
- "master"
- "*-rc"
pull_request:
types: [opened, reopened, synchronize]
branches:
- "**"

jobs:
prepare-rskj:
build-rskj:
runs-on: ubuntu-latest
container:
image: openjdk:8-jdk
Expand Down Expand Up @@ -52,7 +56,7 @@ jobs:
rskj-core/build
smell-test:
needs: prepare-rskj
needs: build-rskj
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -88,7 +92,7 @@ jobs:
path: |
rskj-core/build
- name: If GH event is PR
- name: Sonarquebe for PRs
if: github.event_name == 'pull_request'
run: |
pr_number=${{ github.event.pull_request.number }}
Expand All @@ -101,7 +105,7 @@ jobs:
-Dsonar.host.url="https://sonarcloud.io" \
-Dsonar.token="${{ secrets.SONAR_TOKEN }}"
- name: If not
- name: Sonarquebe for master
if: github.event_name != 'pull_request'
run: |
./gradlew sonarqube --no-daemon -x build -x test \
Expand All @@ -110,74 +114,8 @@ jobs:
-Dsonar.host.url="https://sonarcloud.io" \
-Dsonar.token="${{ secrets.SONAR_TOKEN }}"
unit-tests:
runs-on: ubuntu-latest
container:
image: openjdk:8-jdk
steps:
- uses: actions/checkout@v4

- name: Setup System Tools
run: |
apt update -y
apt install -y curl
- uses: actions/cache@v4
name: Cache Gradle
id: cache-gradle
with:
path: |
.gradle/caches
gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Get gradle wrapper and build dependencies
if: steps.cache-gradle.outputs.cache-hit != 'true'
run: |
./configure.sh
./gradlew --no-daemon dependencies
- name: Run tests
run: |
./gradlew --no-daemon --stacktrace test
integration-tests:
runs-on: ubuntu-latest
container:
image: openjdk:8-jdk
steps:
- uses: actions/checkout@v4

- name: Setup System Tools
run: |
apt update -y
apt install -y curl
- uses: actions/cache@v4
name: Cache Gradle
id: cache-gradle
with:
path: |
.gradle/caches
gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Get gradle wrapper and build dependencies
if: steps.cache-gradle.outputs.cache-hit != 'true'
run: |
./configure.sh
./gradlew --no-daemon dependencies
- name: Run tests
run: |
./gradlew --no-daemon --stacktrace integrationTest
mining-tests:
needs: prepare-rskj
needs: build-rskj
runs-on: ubuntu-latest
services:
bitcoind1:
Expand Down Expand Up @@ -281,4 +219,70 @@ jobs:
fi
npm test
kill $rskpid
kill $rskpid
unit-tests:
runs-on: ubuntu-latest
container:
image: openjdk:8-jdk
steps:
- uses: actions/checkout@v4

- name: Setup System Tools
run: |
apt update -y
apt install -y curl
- uses: actions/cache@v4
name: Cache Gradle
id: cache-gradle
with:
path: |
.gradle/caches
gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Get gradle wrapper and build dependencies
if: steps.cache-gradle.outputs.cache-hit != 'true'
run: |
./configure.sh
./gradlew --no-daemon dependencies
- name: Run tests
run: |
./gradlew --no-daemon --stacktrace test
integration-tests:
runs-on: ubuntu-latest
container:
image: openjdk:8-jdk
steps:
- uses: actions/checkout@v4

- name: Setup System Tools
run: |
apt update -y
apt install -y curl
- uses: actions/cache@v4
name: Cache Gradle
id: cache-gradle
with:
path: |
.gradle/caches
gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Get gradle wrapper and build dependencies
if: steps.cache-gradle.outputs.cache-hit != 'true'
run: |
./configure.sh
./gradlew --no-daemon dependencies
- name: Run tests
run: |
./gradlew --no-daemon --stacktrace integrationTest

0 comments on commit 862d615

Please sign in to comment.