Revert CI Workflow #40
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
name: Build and Test | |
on: | |
pull_request: | |
types: [opened, edited, ready_for_review, reopened] | |
jobs: | |
run-build-test: | |
strategy: | |
fail-fast: false | |
max-parallel: 8 | |
matrix: | |
os: [ubuntu-latest, macos-12] | |
go-version: [1.18] | |
ignite-version: [v0.23.0, v0.24.0] | |
name: "Build/Test ${{ matrix.os }}; Go ${{ matrix.go-version }}; Ignite ${{ matrix.ignite-version }}" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: ~${{ matrix.go-version }} | |
- name: Get changed files for Blockchain modules | |
id: changed-files-chain | |
uses: tj-actions/changed-files@v34 | |
with: | |
since_last_remote_commit: false | |
files: | | |
x/** | |
app/** | |
cmd/** | |
proto/bucket/** | |
proto/registry/** | |
proto/schema/** | |
- name: Run build against Release target for macos | |
if: matrix.os == 'macos-12' && steps.changed-files-chain.outputs.any_changed == 'true' | |
continue-on-error: false | |
run: | | |
sudo curl https://get.ignite.com/cli@${{matrix.ignite-version}}! | sudo bash | |
go mod download | |
ignite chain build --release -t darwin:amd64 | |
- name: Run build against Release target for ubuntu | |
if: matrix.os == 'ubuntu-latest' && steps.changed-files-chain.outputs.any_changed == 'true' | |
continue-on-error: false | |
run: | | |
sudo curl https://get.ignite.com/cli@${{matrix.ignite-version}}! | sudo bash | |
go mod download | |
ignite chain build --release -t linux:amd64 | |
run-bind-test: | |
strategy: | |
max-parallel: 8 | |
matrix: | |
platform: [ios, web, android] | |
build-on: [ubuntu-latest, macos-latest] | |
go-version: [1.17, 1.18] | |
# https://github.com/android/ndk/wiki/Unsupported-Downloads && https://developer.android.com/ndk/downloads | |
ndk-version: [r22b, r23c] # Target is 23, but local is 24 - need solve this | |
exclude: | |
# Don't build on incompatible targets | |
- build-on: ubuntu-latest | |
platform: ios | |
- build-on: macos-latest | |
platform: android | |
# Don't pollute the build matrix cause of android on ios | |
- platform: ios | |
ndk-version: r22b | |
- platform: ios | |
ndk-version: r23c | |
# - platform: ios | |
# ndk-version: r24 | |
# - platform: ios | |
# ndk-version: r25b | |
# Don't pollute the build matrix cause of android on web | |
- platform: web | |
ndk-version: r22b | |
- platform: web | |
ndk-version: r23c | |
# - platform: web | |
# ndk-version: r24 | |
# - platform: web | |
# ndk-version: r25b | |
fail-fast: false | |
name: "Bind ${{ matrix.platform }}; ${{ matrix.build-on }}; Go ${{ matrix.go-version }}; NDK ${{ matrix.ndk-version }}" | |
runs-on: ${{ matrix.build-on }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get changed files for Motor modules | |
id: changed-files-motor | |
uses: tj-actions/changed-files@v34 | |
with: | |
since_last_remote_commit: false | |
files: | | |
internal/** | |
proto/motor/** | |
proto/service/** | |
pkg/motor/** | |
pkg/crypto/** | |
pkg/client/** | |
pkg/did/** | |
pkg/tx/** | |
pkg/vault/** | |
- id: setup-ndk | |
uses: nttld/setup-ndk@v1 | |
if: matrix.platform == 'android' && steps.changed-files-motor.outputs.any_changed == 'true' | |
with: | |
ndk-version: ${{ matrix.ndk-version }} | |
add-to-path: true | |
- uses: actions/setup-java@v3 | |
if: matrix.platform == 'android' && steps.changed-files-motor.outputs.any_changed == 'true' | |
with: | |
distribution: "temurin" # See 'Supported distributions' for available options | |
java-version: "17" | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: ~${{ matrix.go-version }} | |
- name: Install Gomobile | |
if: steps.changed-files-motor.outputs.any_changed == 'true' | |
run: | | |
go install golang.org/x/mobile/cmd/gomobile@latest | |
go install golang.org/x/mobile/cmd/gobind@latest | |
go get golang.org/x/mobile/cmd/gobind | |
go get golang.org/x/mobile/cmd/gomobile | |
gomobile init | |
env: | |
GOPROXY: https://proxy.golang.org,direct | |
GO111MODULE: "on" | |
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} | |
- name: Test Motor Bind | |
if: steps.changed-files-motor.outputs.any_changed == 'true' | |
run: make bind.${{ matrix.platform }} | |
env: | |
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} | |
run-test-suite: | |
strategy: | |
fail-fast: false | |
max-parallel: 8 | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
go-version: [1.18] | |
ignite-version: [v0.23.0, v0.24.0] | |
name: "Test ${{ matrix.os }}; Go ${{ matrix.go-version }}; Ignite ${{ matrix.ignite-version }}" | |
runs-on: ${{ matrix.os }} | |
needs: | |
- run-build-test | |
- run-bind-test | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: ~${{ matrix.go-version }} | |
- name: Run tests and evaluate coverage | |
continue-on-error: true | |
run: go test -race -coverprofile=coverage.out -covermode=atomic ./... | |
- name: Run simulate | |
continue-on-error: true | |
run: go test -benchmem -run=^$ -bench ^BenchmarkSimulation ./app -NumBlocks=200 -BlockSize 50 -Commit=true -Verbose=true -Enabled=true | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 |