Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Merge pull request #140 from findy-network/dependabot/go_modules/gola… #505

Merge pull request #140 from findy-network/dependabot/go_modules/gola…

Merge pull request #140 from findy-network/dependabot/go_modules/gola… #505

Workflow file for this run

name: test
on: push
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: setup go and lint
uses: findy-network/setup-go-action@master
with:
linter-config-path: ".golangci.yml"
setup-script: "make indy_to_debian"
skip-scan: "true"
# test with internal ledger
- name: test and measure coverage
run: make test_cov_out COV_FILE=coverage1.txt
- name: store coverage file
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}-coverage1.txt
path: ./coverage1.txt
retention-days: 1
test-with-indy-ledger:
strategy:
matrix:
include:
- pool_config: "FINDY_LEDGER,test"
coverage_file: "coverage-indy-ledger"
- pool_config: "FINDY_LEDGER,test,FINDY_MEM_LEDGER,cache"
coverage_file: "coverage-indy-ledger-cache"
runs-on: ubuntu-latest
steps:
# setup indy ledger
- uses: actions/checkout@v4
with:
repository: "bcgov/von-network"
- name: skip setting volumes for web server
run: |
sed '/ - .\/config:\/home\/indy\/config/d' docker-compose.yml > docker-compose.yml.tmp
sed '/ - .\/server:\/home\/indy\/server/d' docker-compose.yml.tmp > docker-compose.yml
- name: start indy ledger
run: |
./manage build
./manage start
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "./go.mod"
- name: install indy cli
run: |
make indy_to_debian
sudo apt-get install -y indy-cli libtinfo5
# test with indy ledger
- name: create pool handle
run: |
curl http://localhost:9000/genesis > gen_txn_file
printf "pool create test gen_txn_file=gen_txn_file" | indy-cli | tee /tmp/indy_cli_output.txt
echo
- name: test and measure coverage with indy
run: make test_cov_out COV_FILE=${{ matrix.coverage_file }}.txt
env:
FINDY_POOL: ${{ matrix.pool_config }}
- name: store coverage file
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}-${{ matrix.coverage_file }}.txt
path: ./${{ matrix.coverage_file }}.txt
retention-days: 1
- name: collect docker logs
if: ${{ failure() }}
uses: jwalton/gh-docker-logs@v2
with:
dest: "./docker-logs"
- name: archive logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: docker-logs
path: docker-logs
service-test:
runs-on: ubuntu-latest
steps:
# install indy
- uses: actions/checkout@v4
- name: install indy
run: make indy_to_debian
- uses: actions/checkout@v4
with:
repository: "findy-network/findy-agent"
ref: dev
path: "./target"
- uses: actions/setup-go@v5
with:
go-version-file: "./go.mod"
- name: test with core service
run: |
cd ./target
go mod edit -replace github.com/findy-network/findy-wrapper-go=../
go mod tidy -e
go test -p 1 -failfast -timeout=1200s \
-coverpkg=github.com/findy-network/findy-wrapper-go/... \
-coverprofile=coverage3.txt \
-covermode=atomic \
./...
- name: store coverage file
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}-coverage3.txt
path: ./target/coverage3.txt
retention-days: 1
upload-coverage:
runs-on: ubuntu-latest
needs: [check, test-with-indy-ledger, service-test]
steps:
- name: checkout
uses: actions/checkout@v4
- name: download coverage file 1
uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}-coverage1.txt
- name: download coverage file with indy ledger
uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}-coverage-indy-ledger.txt
- name: download coverage file with indy ledger and cache
uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}-coverage-indy-ledger-cache.txt
- name: download coverage file 3
uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}-coverage3.txt
- name: upload coverage
uses: codecov/codecov-action@v4
with:
files: ./coverage1.txt,./coverage-indy-ledger.txt,./coverage-indy-ledger-cache.txt,./coverage3.txt
fail_ci_if_error: ${{ github.ref_name != 'dev' }}
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}