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

Merge pull request #547 from findy-network/dependabot/go_modules/dev/… #1992

Merge pull request #547 from findy-network/dependabot/go_modules/dev/…

Merge pull request #547 from findy-network/dependabot/go_modules/dev/… #1992

Workflow file for this run

name: test
on:
push:
jobs:
check:
runs-on: ubuntu-latest
env:
TEST_WORKDIR: /github/home/.test/
CI: true
steps:
# install indy
- uses: actions/checkout@v4
with:
repository: "findy-network/findy-wrapper-go"
- name: install indy
run: make indy_to_debian
- name: setup go, lint and scan
uses: findy-network/setup-go-action@master
with:
linter-config-path: .golangci.yml
- name: test and measure coverage (peer did)
run: make test_cov_out COV_FILE=coverage-peer.txt
env:
FCLI_AGENCY_DID_METHOD: "2"
- name: store coverage file
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}-coverage-peer.txt
path: ./coverage-peer.txt
retention-days: 1
test-default:
runs-on: ubuntu-latest
env:
TEST_WORKDIR: /github/home/.test/
CI: true
steps:
# setup von-network ledger
- uses: actions/checkout@v4
with:
repository: "bcgov/von-network"
ref: "22973513c99cc9a286a6f181ca5c5f354a4eb2ee"
- 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
# install indy
- uses: actions/checkout@v4
with:
repository: "findy-network/findy-wrapper-go"
- name: install indy
run: make indy_to_debian
# setup go-env
- name: setup
uses: actions/setup-go@v5
with:
go-version-file: "./go.mod"
- name: checkout
uses: actions/checkout@v4
# test round for sov-did (default) and indy ledger
- name: test and measure coverage
run: |
curl http://localhost:9000/genesis > gen_txn_file
make test_grpcv_cov_out COV_FILE=coverage-default.txt
env:
TEST_TIMEOUT: 6000s
TEST_ARGS: "-vmodule=grpc_test*=5 -v=0 -logtostderr"
FCLI_POOL_NAME: "von"
FCLI_AGENCY_POOL_NAME: "FINDY_LEDGER,von"
- name: store coverage file
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}-coverage-default.txt
path: ./coverage-default.txt
retention-days: 1
e2e:
runs-on: ubuntu-latest
steps:
# install indy
- uses: actions/checkout@v4
with:
repository: "findy-network/findy-wrapper-go"
- name: install indy
run: make indy_to_debian
- name: setup
uses: actions/setup-go@v5
with:
go-version-file: "./go.mod"
- name: checkout
uses: actions/checkout@v4
- name: install cli
run: |
curl https://raw.githubusercontent.com/findy-network/findy-agent-cli/HEAD/install.sh > install.sh
chmod a+x install.sh
sudo ./install.sh -b /bin
- name: test
run: make e2e_ci
- name: Collect docker logs
if: ${{ failure() }}
uses: jwalton/gh-docker-logs@v2
with:
dest: "./tests_output/docker-logs"
- name: archive logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: e2e-logs
path: tests_output
e2e-full:
runs-on: ubuntu-latest
steps:
# TODO: implement graceful shutdown to collect coverage data
- name: test e2e flow
uses: findy-network/e2e-test-action@master
with:
service: "core"
service-context: ./
service-dockerfile: ./scripts/deploy/Dockerfile
- uses: actions/setup-go@v5
with:
go-version-file: "./go.mod"
- name: convert coverage to txt
run: go tool covdata textfmt -i=coverage -o coverage-e2e.txt
- name: store coverage file
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}-coverage-e2e.txt
path: ./coverage-e2e.txt
retention-days: 1
upload-coverage:
runs-on: ubuntu-latest
needs: [check, test-default, e2e-full]
steps:
- name: checkout
uses: actions/checkout@v4
- name: download coverage file
uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}-coverage-default.txt
- name: download coverage file
uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}-coverage-peer.txt
- name: download coverage file
uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}-coverage-e2e.txt
- name: upload coverage
uses: codecov/codecov-action@v4
with:
files: ./coverage-default.txt,./coverage-peer.txt,./coverage-e2e.txt
fail_ci_if_error: ${{ github.ref_name != 'dev' }}
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}