Skip to content

Update Milestone7_delivery.md #1136

Update Milestone7_delivery.md

Update Milestone7_delivery.md #1136

Workflow file for this run

name: Go
on:
push:
# branches: [ "develop" ]
# pull_request:
# branches: [ "develop" ]
jobs:
unit_tests:
name: Unit Tests
runs-on: ubuntu-latest
# Service containers to run with `runner-job`
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Unit Test
run: |
cd ./src
go test -v ./pkg/...
integration_tests:
name: Integration Tests
runs-on: ubuntu-latest
permissions:
packages: read
contents: read
actions: read
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Go mod download
run: cd ./src && go mod download
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run Docker Compose
run: docker compose up -d
- name: Run Integration Tests
working-directory: ./src/tests/api
run: go test -v ./... -ci_run
- name: Print Containers Logs
run: |
echo "::group::Gateway service logs"
docker logs ipehr-gateway-ipehr-gateway-1
echo "::endgroup::"
echo "::group::Stat service logs"
docker logs ipehr-gateway-ipehr-stat-1
echo "::endgroup::"
echo "::group::Hardhat index logs"
docker logs ipehr-gateway-ipehr-index-1
echo "::endgroup::"
- name: Save Containers Logs
if: failure()
run: |
mkdir logs
cd logs
docker logs ipehr-gateway-ipehr-gateway-1 &> ./gateway.log
docker logs ipehr-gateway-ipehr-index-1 &> ./index.log
docker logs ipehr-gateway-ipehr-stat-1 &> ./stat.log
- name: Archive Logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: logs
path: ./logs
- name: Stop containers
if: always()
run: docker compose -f "docker-compose.yml" down