Skip to content

[CI] Fix fetch to work from main #5

[CI] Fix fetch to work from main

[CI] Fix fetch to work from main #5

Workflow file for this run

# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
name: CI
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]
env:
DB_DEPLOYMENT: local
jobs:
lint:
name: Lint and Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: scripts/install-dev-dependencies.sh
- name: Lint
run: |
# Apply automatic formatting.
gofmt -w .
goimports -local "github.com/hyperledger/fabric-x-committer" -w .
# Re make protobufs, overwriting any formatting
PATH="$HOME/bin:$PATH" make proto
# Check if original code changed due to formatting.
git diff --exit-code
# Fetch main to only show new lint issues.
git fetch -u origin main:main
make lint
- name: Build
run: make build
unit-test:
name: Unit Test (non DB)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: scripts/install-dev-dependencies.sh
- run: make test-no-db
db-test:
name: Requires and Core DB Tests (postgres)
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16.9
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5433/tcp
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: scripts/install-dev-dependencies.sh
- run: make test-requires-db test-core-db
core-db-test:
name: Core DB Tests (yugabyte)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: yugabyte/yugabyte-db-action@master
- run: scripts/install-dev-dependencies.sh
- run: make test-core-db
integration-test:
name: Integration Tests (yugabyte)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: scripts/install-dev-dependencies.sh
- run: scripts/get-and-start-yuga.sh
- run: make test-integration
db-resiliency-test:
name: Integration DB Resiliency (container)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: scripts/install-dev-dependencies.sh
- run: make test-integration-db-resiliency
container-test:
name: Build and test all-in-one test image (container)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: scripts/install-dev-dependencies.sh
- run: make test-container