Co-authored-by: Marko <marko@baricevic.me> Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
co-authored by
Marko
Julien Robert
parent
fb699ac31a
commit
0b6205e49e
@@ -26,35 +26,14 @@ jobs:
|
||||
with:
|
||||
go-version: "1.23"
|
||||
check-latest: true
|
||||
- name: Get rocksdb version
|
||||
run: ./.github/scripts/get-rocksdb-version.sh
|
||||
- name: Fix permissions for cache
|
||||
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
|
||||
- name: Restore rocksdb libraries cache
|
||||
id: cache-rocksdb
|
||||
if: matrix.go-arch == 'amd64'
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
/usr/local/lib/librocksdb.*
|
||||
/usr/local/include/rocksdb
|
||||
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-${{ matrix.go-arch }}
|
||||
- name: Install rocksdb deps
|
||||
if: matrix.go-arch == 'amd64'
|
||||
run: ./.github/scripts/install-rocksdb-deps.sh
|
||||
- name: Install rocksdb
|
||||
if: matrix.go-arch == 'amd64' && steps.cache-rocksdb.outputs.cache-hit != 'true'
|
||||
run: ./.github/scripts/install-rocksdb.sh
|
||||
- name: install aarch64-gcc
|
||||
if: matrix.go-arch == 'arm64'
|
||||
run: sudo apt-get install gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
|
||||
###################
|
||||
#### Build App ####
|
||||
###################
|
||||
- name: Build
|
||||
run: GOARCH=${{ matrix.go-arch }} make build
|
||||
- name: Build Legacy
|
||||
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS=legacy make build
|
||||
- name: Build with rocksdb backend
|
||||
if: matrix.go-arch == 'amd64'
|
||||
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS="rocksdb" make build
|
||||
- name: Build with sqlite backend
|
||||
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS=v2,sqlite make build
|
||||
- name: Build with BLS12381
|
||||
if: matrix.go-arch == 'amd64'
|
||||
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS="bls12381" make build
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
name: Cache rocksdb libraries
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- build.mk
|
||||
schedule:
|
||||
- cron: "15 */2 * * *" # Every two hours at xx:15 minutes
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
|
||||
check-cache-rocksdb:
|
||||
name: Check existing cache
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
cache-hit: ${{ steps.cache-rocksdb.outputs.cache-hit }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Get rocksdb version
|
||||
run: ./.github/scripts/get-rocksdb-version.sh
|
||||
|
||||
- name: Fix permissions for cache
|
||||
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
|
||||
|
||||
- name: Restore rocksdb libraries cache
|
||||
id: cache-rocksdb
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
/usr/local/lib/librocksdb.*
|
||||
/usr/local/include/rocksdb
|
||||
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
|
||||
|
||||
|
||||
save-cache-rocksdb:
|
||||
name: Build rocksdb libraries and save cache
|
||||
runs-on: ubuntu-latest
|
||||
needs: check-cache-rocksdb
|
||||
if: needs.check-cache-rocksdb.outputs.cache-hit != 'true'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Get rocksdb version
|
||||
run: ./.github/scripts/get-rocksdb-version.sh
|
||||
|
||||
- name: Install rocksdb deps
|
||||
run: ./.github/scripts/install-rocksdb-deps.sh
|
||||
- name: Install rocksdb
|
||||
run: ./.github/scripts/install-rocksdb.sh
|
||||
|
||||
- name: Saves rocksdb libraries cache
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: |
|
||||
/usr/local/lib/librocksdb.*
|
||||
/usr/local/include/rocksdb
|
||||
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
|
||||
@@ -27,30 +27,11 @@ jobs:
|
||||
Makefile
|
||||
**/Makefile
|
||||
.golangci.yml
|
||||
- name: Get rocksdb version
|
||||
run: ./.github/scripts/get-rocksdb-version.sh
|
||||
- name: Fix permissions for cache
|
||||
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
|
||||
- name: Restore rocksdb libraries cache
|
||||
id: cache-rocksdb
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
/usr/local/lib/librocksdb.*
|
||||
/usr/local/include/rocksdb
|
||||
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
|
||||
- name: Install rocksdb deps
|
||||
run: ./.github/scripts/install-rocksdb-deps.sh
|
||||
- name: Install rocksdb
|
||||
if: steps.cache-rocksdb.outputs.cache-hit != 'true'
|
||||
run: ./.github/scripts/install-rocksdb.sh
|
||||
- name: run linting (long)
|
||||
if: env.GIT_DIFF
|
||||
id: lint_long
|
||||
run: |
|
||||
make lint
|
||||
env:
|
||||
ROCKSDB: 1
|
||||
- uses: technote-space/get-diff-action@v6.1.2
|
||||
if: steps.lint_long.outcome == 'skipped'
|
||||
with:
|
||||
|
||||
@@ -745,28 +745,11 @@ jobs:
|
||||
store/**/*.go
|
||||
store/go.mod
|
||||
store/go.sum
|
||||
- name: Get rocksdb version
|
||||
run: ./.github/scripts/get-rocksdb-version.sh
|
||||
- name: Fix permissions for cache
|
||||
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
|
||||
- name: Restore rocksdb libraries cache
|
||||
id: cache-rocksdb
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
/usr/local/lib/librocksdb.*
|
||||
/usr/local/include/rocksdb
|
||||
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
|
||||
- name: Install rocksdb deps
|
||||
run: ./.github/scripts/install-rocksdb-deps.sh
|
||||
- name: Install rocksdb
|
||||
if: steps.cache-rocksdb.outputs.cache-hit != 'true'
|
||||
run: ./.github/scripts/install-rocksdb.sh
|
||||
- name: tests
|
||||
if: env.GIT_DIFF
|
||||
run: |
|
||||
cd store
|
||||
go test -ldflags "-r /usr/local/lib" -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb' ./...
|
||||
go test -ldflags "-r /usr/local/lib" -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./...
|
||||
- name: sonarcloud
|
||||
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
|
||||
uses: SonarSource/sonarcloud-github-action@master
|
||||
@@ -795,28 +778,11 @@ jobs:
|
||||
store/v2/**/*.go
|
||||
store/v2/go.mod
|
||||
store/v2/go.sum
|
||||
- name: Get rocksdb version
|
||||
run: ./.github/scripts/get-rocksdb-version.sh
|
||||
- name: Fix permissions for cache
|
||||
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
|
||||
- name: Restore rocksdb libraries cache
|
||||
id: cache-rocksdb
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
/usr/local/lib/librocksdb.*
|
||||
/usr/local/include/rocksdb
|
||||
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
|
||||
- name: Install rocksdb deps
|
||||
run: ./.github/scripts/install-rocksdb-deps.sh
|
||||
- name: Install rocksdb
|
||||
if: steps.cache-rocksdb.outputs.cache-hit != 'true'
|
||||
run: ./.github/scripts/install-rocksdb.sh
|
||||
- name: test & coverage report creation
|
||||
if: env.GIT_DIFF
|
||||
run: |
|
||||
cd store/v2
|
||||
go test -ldflags "-r /usr/local/lib" -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb' ./...
|
||||
go test -ldflags "-r /usr/local/lib" -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./...
|
||||
- name: sonarcloud
|
||||
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
|
||||
uses: SonarSource/sonarcloud-github-action@master
|
||||
|
||||
Reference in New Issue
Block a user