Skip to content

Commit

Permalink
Merge branch 'main' into feat/c509_cli
Browse files Browse the repository at this point in the history
  • Loading branch information
bkioshn authored Jul 20, 2024
2 parents 35d3366 + fcaca99 commit 4982398
Show file tree
Hide file tree
Showing 17 changed files with 505 additions and 421 deletions.
8 changes: 5 additions & 3 deletions .config/dictionaries/project.dic
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ afinet
androidx
anypolicy
appspot
Arissara
Arbritrary
ARGB
Arissara
asmjs
asyncio
asyncpg
Expand All @@ -25,11 +25,12 @@ bluefireteam
BROTLI
canvaskit
cardano
carryforward
Catalyst
CBOR
cborg
CEST
cdylib
CEST
cfbundle
Chotivichit
chromedriver
Expand All @@ -40,6 +41,7 @@ COCOAPODS
codegen
codepoints
coti
coverallsapp
cryptoxide
Cunego
Cupertino
Expand Down Expand Up @@ -239,4 +241,4 @@ xcodeproj
xctest
xctestrun
xcworkspace
yoroi
yoroi
80 changes: 77 additions & 3 deletions .github/workflows/generate-allure-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ env:
EARTHLY_TARGET: docker
ECR_REGISTRY: 332405224602.dkr.ecr.eu-central-1.amazonaws.com
ALLURE_REPORT_PATH: allure-report
COVERAGE_REPORT_PATH: coverage-report
REPORT_EXT: .junit-report.xml
COVERAGE_EXT: .info

jobs:
generate-test-reports:
Expand Down Expand Up @@ -71,8 +73,8 @@ jobs:
target_flags:
runner_address: ${{ secrets.EARTHLY_SATELLITE_ADDRESS }}
artifact: "false"
- name: Get backend python test report

- name: Get python api test report
uses: input-output-hk/catalyst-ci/actions/run@master
if: always()
continue-on-error: true
Expand All @@ -88,10 +90,20 @@ jobs:
uses: actions/upload-artifact@v4
if: always()
with:
name: test-reports
path: '**/*${{ env.REPORT_EXT }}'
if-no-files-found: error
retention-days: 1

- name: Collect and upload test coverage
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-reports
path: '**/*${{ env.COVERAGE_EXT }}'
if-no-files-found: error
retention-days: 1

generate-allure-report:
name: Generate allure report
runs-on: ubuntu-latest
Expand All @@ -100,6 +112,8 @@ jobs:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: test-reports

- name: Setup Allure report
run: |
Expand Down Expand Up @@ -136,4 +150,64 @@ jobs:
message: |
${{ steps.allure.outputs.test_result_icon }} [Test Report](${{ steps.allure.outputs.report_url }}) | ${\color{lightgreen}Pass: ${{ steps.allure.outputs.test_result_passed }}/${{ steps.allure.outputs.test_result_total }}}$ | ${\color{red}Fail: ${{ steps.allure.outputs.test_result_failed }}/${{ steps.allure.outputs.test_result_total }}}$ |
comment_tag: allure_report
mode: upsert
mode: upsert

generate-coverage-report:
name: Generate coverage report
runs-on: ubuntu-latest
needs: [generate-test-reports]
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: coverage-reports

- name: Collect coverage report
run: |
mkdir -p ${{ env.COVERAGE_REPORT_PATH }}
shopt -s globstar
cp **/*${{ env.COVERAGE_EXT }} ${{ env.COVERAGE_REPORT_PATH }}
ls ${{ env.COVERAGE_REPORT_PATH }}
- name: Normalize coverage report paths
run: |
sed -i -e 's/SF:\/root/SF:catalyst-gateway/g' ${{ env.COVERAGE_REPORT_PATH }}/cat-gateway.coverage.info
sed -i -e 's/SF:lib/SF:catalyst_voices\/lib/g' ${{ env.COVERAGE_REPORT_PATH }}/lcov.info
cat ${{ env.COVERAGE_REPORT_PATH }}/cat-gateway.coverage.info
- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: coverallsapp/github-action@v2
with:
path-to-lcov: "${{ env.COVERAGE_REPORT_PATH }}/cat-gateway.coverage.info"
allow-empty: true
debug: true
flag-name: rust-unit-test
base-path: "/home/runner/work/catalyst-voices/catalyst-voices/"
parallel: true

- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: coverallsapp/github-action@v2
with:
path-to-lcov: "${{ env.COVERAGE_REPORT_PATH }}/lcov.info"
allow-empty: true
debug: true
flag-name: flutter-test
base-path: "/home/runner/work/catalyst-voices/catalyst-voices/"
parallel: true

upload-coverage-report:
name: Upload coverage report
needs: [generate-coverage-report]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
carryforward: "rust-unit-test,flutter-test"
6 changes: 3 additions & 3 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.1.17 AS mdlint-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.1.17 AS cspell-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/postgresql:v3.1.17 AS postgresql-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.1.18 AS mdlint-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.1.18 AS cspell-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/postgresql:v3.1.18 AS postgresql-ci

FROM debian:stable-slim

Expand Down
4 changes: 2 additions & 2 deletions catalyst-gateway-crates/c509-certificate/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.1.17 AS rust-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.1.18 AS rust-ci

# builder : Set up our target toolchains, and copy our files.
builder:
Expand All @@ -20,7 +20,7 @@ build:
DO rust-ci+EXECUTE \
--cmd="/scripts/std_build.py" \
--args1="--libs=c509-certificate"

# RUN wasm-pack build --target web

package:
Expand Down
2 changes: 1 addition & 1 deletion catalyst-gateway/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ target/
*.pdb

# Build artifacts
cat-gateway.coverage-report.info
cat-gateway.coverage.info
cat-gateway.junit-report.xml
cat-gateway-api.*
6 changes: 3 additions & 3 deletions catalyst-gateway/Earthfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.1.17 AS rust-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/mithril_snapshot:v3.1.17 AS mithril-snapshot-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.1.18 AS rust-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/mithril_snapshot:v3.1.18 AS mithril-snapshot-ci

#cspell: words rustfmt toolsets USERARCH

Expand Down Expand Up @@ -40,7 +40,7 @@ build:
--args2="--cov_report=$HOME/coverage-report.info" \
--output="release/cat-gateway" \
--junit="cat-gateway.junit-report.xml" \
--coverage="cat-gateway.coverage-report.info" \
--coverage="cat-gateway.coverage.info" \
--docs="true"

# Generate the OpenAPI doc from the cat-gateway executable itself.
Expand Down
6 changes: 3 additions & 3 deletions catalyst-gateway/event-db/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# the database and its associated software.
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/postgresql:v3.1.17 AS postgresql-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/postgresql:v3.1.18 AS postgresql-ci

# cspell: words

Expand All @@ -23,7 +23,7 @@ build:
FROM +builder

DO postgresql-ci+BUILD --image_name=event-db
DO postgresql-ci+DOCS
DO postgresql-ci+DOCS

# local : Make a locally run-able container that can serve the db.
# --push will cause this image to be pushed to the local development cluster
Expand All @@ -36,7 +36,7 @@ local:

FROM +build

# Publish to the local development cluster
# Publish to the local development cluster
IF [ "$local_registry" != "" ]
SAVE IMAGE --push --insecure $local_registry/event-db:latest
END
Expand Down
2 changes: 1 addition & 1 deletion catalyst-gateway/tests/Earthfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION 0.8
IMPORT github.com/input-output-hk/catalyst-ci/earthly/spectral:v3.1.17 AS spectral-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/spectral:v3.1.18 AS spectral-ci

# test-lint-openapi - OpenAPI linting from an artifact
# testing whether the OpenAPI generated during build stage follows good practice.
Expand Down
11 changes: 7 additions & 4 deletions catalyst-gateway/tests/api_tests/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/python:v3.1.17 AS python-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/python:v3.1.18 AS python-ci

builder:
FROM python-ci+python-base
Expand All @@ -13,17 +13,20 @@ builder:
# Disabled in CI, to enable rename it to `test`.
api-test:
FROM +builder
RUN apk update && apk add iptables-legacy # workaround for https://github.com/earthly/earthly/issues/3784

COPY ./docker-compose.yml .

WITH DOCKER \
--compose docker-compose.yml \
--load event-db:latest=(../../event-db+build) \
--load cat-gateway:latest=(../../+package-cat-gateway-with-preprod) \
--load cat-gateway:latest=(../../+package-cat-gateway-with-preprod-snapshot) \
--service cat-gateway \
--allow-privileged
RUN poetry run pytest -s --junitxml=junit-report.xml
RUN poetry run pytest -s --junitxml=junit-report.xml --cov=api_tests --cov-report lcov
END
WAIT
SAVE ARTIFACT junit-report.xml AS LOCAL backendpython.junit-report.xml
SAVE ARTIFACT junit-report.xml AS LOCAL api-tests.junit-report.xml
SAVE ARTIFACT coverage.lcov AS LOCAL api-tests.coverage.info

END
Loading

0 comments on commit 4982398

Please sign in to comment.