Skip to content

Commit

Permalink
Merge branch 'main' into loadtest-snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
kukkok3 committed Nov 20, 2023
2 parents e58540c + 9411936 commit 9a25b3b
Show file tree
Hide file tree
Showing 242 changed files with 15,352 additions and 677 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,34 @@ permissions:
contents: read
packages: write

env:
AWS_REGION: eu-central-1
AWS_ROLE_ARN: arn:aws:iam::332405224602:role/ci
ECR_REGISTRY: 332405224602.dkr.ecr.eu-central-1.amazonaws.com
TAG: ${{ github.sha }}

jobs:
build:
name: CI Test
runs-on: ubuntu-latest
env:
FORCE_COLOR: 1
steps:
- name: Install Earthly
uses: earthly/actions/setup-earthly@v1
with:
version: v0.7.0
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to GitHub Container Registry
- name: Setup CI
uses: input-output-hk/catalyst-ci/actions/setup@master
with:
aws_role_arn: ${{ env.AWS_ROLE_ARN }}
aws_region: ${{ env.AWS_REGION }}
earthly_runner_secret: ${{ secrets.EARTHLY_RUNNER_SECRET }}
- name: Login to ECR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.ECR_REGISTRY }}
- name: Run tests
env:
EARTHLY_SECRETS: "IDEASCALE_EMAIL=${{ secrets.IDEASCALE_EMAIL }}, IDEASCALE_PASSWORD=${{ secrets.IDEASCALE_PASSWORD }}, IDEASCALE_API_TOKEN=${{ secrets.IDEASCALE_API_TOKEN }}"
run: |
earthly -P --remote-cache=ghcr.io/${{ github.repository }}:cache +test
earthly -P --buildkit-host "tcp://${{ secrets.EARTHLY_SATELLITE_ADDRESS }}:8372" +test-all
119 changes: 18 additions & 101 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,110 +2,27 @@ name: CI

on:
push:
branches:
- main
paths:
- ".github/workflows/ci.yml"
- "containers/**"
- "services/**"
- "src/**"
- "utilities/**"

permissions:
id-token: write
contents: read
contents: write
packages: write

env:
AWS_REGION: eu-central-1
AWS_ROLE_ARN: arn:aws:iam::332405224602:role/ci
EARTHLY_TARGET: docker
EARTHLY_VERSION: 0.7.6
ECR_REGISTRY: 332405224602.dkr.ecr.eu-central-1.amazonaws.com
TAG: ${{ github.sha }}

jobs:
discover:
runs-on: ubuntu-latest
outputs:
json: ${{ steps.discover.outputs.json}}
images: ${{ steps.discover.outputs.images}}
steps:
- uses: actions/checkout@v3
- name: Setup CI
uses: input-output-hk/catalyst-ci/actions/setup@master
with:
aws_role_arn: ${{ env.AWS_ROLE_ARN }}
aws_region: ${{ env.AWS_REGION }}
earthly_version: ${{ env.EARTHLY_VERSION }}
- name: Discover Earthfiles
uses: input-output-hk/catalyst-ci/actions/discover@master
id: discover
with:
parse_images: "true"
targets: ${{ env.EARTHLY_TARGET }}
cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup CI
uses: input-output-hk/catalyst-ci/actions/setup@master
with:
aws_role_arn: ${{ env.AWS_ROLE_ARN }}
aws_region: ${{ env.AWS_REGION }}
earthly_version: ${{ env.EARTHLY_VERSION }}
- name: Build cache
uses: input-output-hk/catalyst-ci/actions/build@master
with:
earthfile: .
earthly_satellite: ${{ secrets.EARTHLY_SATELLITE_ADDRESS }}
target: builder
build:
runs-on: ubuntu-latest
needs: [cache, discover]
strategy:
fail-fast: false
matrix:
earthfile: ${{ fromJson(needs.discover.outputs.json) }}
steps:
- uses: actions/checkout@v3
- name: Setup CI
uses: input-output-hk/catalyst-ci/actions/setup@master
with:
aws_role_arn: ${{ env.AWS_ROLE_ARN }}
aws_region: ${{ env.AWS_REGION }}
earthly_version: ${{ env.EARTHLY_VERSION }}
- name: Login to ECR
uses: docker/login-action@v2
with:
registry: ${{ env.ECR_REGISTRY }}
- name: Build and publish
uses: input-output-hk/catalyst-ci/actions/build@master
with:
earthfile: ${{ matrix.earthfile.path }}
earthly_satellite: ${{ secrets.EARTHLY_SATELLITE_ADDRESS }}
images: ${{ matrix.earthfile.images }}
publish: "true"
registry: ${{ env.ECR_REGISTRY }}
tags: "${{ env.TAG }}"
target: ${{ env.EARTHLY_TARGET }}
deploy:
runs-on: ubuntu-latest
needs: [discover, build]
steps:
- name: Setup CI
uses: input-output-hk/catalyst-ci/actions/setup@master
id: setup
with:
aws_role_arn: ${{ env.AWS_ROLE_ARN }}
aws_region: ${{ env.AWS_REGION }}
earthly_version: ${{ env.EARTHLY_VERSION }}
- name: Deploy
uses: input-output-hk/catalyst-ci/actions/deploy@master
with:
deployment_repo: input-output-hk/catalyst-world
# NOTE: For new services being deployed, this list must be updated
images: cat-data-service fragment-exporter migrations voting-node
environment: dev
tag: ${{ env.TAG }}
token: ${{ steps.setup.outputs.token }}
ci:
uses: input-output-hk/catalyst-ci/.github/workflows/ci.yml@master
with:
aws_ecr_registry: 332405224602.dkr.ecr.eu-central-1.amazonaws.com
aws_role_arn: arn:aws:iam::332405224602:role/ci
aws_region: eu-central-1
deployment_images: |
cat-data-service
fragment-exporter
migrations
voting-node
secrets:
deployment_token: ${{ secrets.CI_BOT_TOKEN }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
earthly_runner_address: ${{ secrets.EARTHLY_SATELLITE_ADDRESS }}
earthly_runner_secret: ${{ secrets.EARTHLY_RUNNER_SECRET }}
20 changes: 15 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:

# We are excluding cat-dat-service and event-db because we are already running it with Earthly
- name: Build and archive tests
run: |
run: |
cargo nextest archive \
--workspace \
--exclude vitup \
Expand All @@ -138,6 +138,10 @@ jobs:
--exclude vit-servicing-station-server \
--exclude vit-servicing-station-tests \
--exclude vit-servicing-station-lib \
--exclude vit-servicing-station-cli-f10 \
--exclude vit-servicing-station-server-f10 \
--exclude vit-servicing-station-tests-f10 \
--exclude vit-servicing-station-lib-f10 \
--exclude cat-data-service \
--exclude event-db \
--exclude wallet-uniffi \
Expand Down Expand Up @@ -211,6 +215,8 @@ jobs:
path: |
target/debug/vit-servicing-station-cli
target/debug/vit-servicing-station-server
target/debug/vit-servicing-station-cli-f10
target/debug/vit-servicing-station-server-f10
target/debug/jcli
target/debug/jormungandr
target/debug/explorer
Expand All @@ -221,7 +227,7 @@ jobs:

- name: Install cargo-make
run: cargo install --force cargo-make

- name: Install refinery
run: cargo install refinery_cli

Expand All @@ -232,7 +238,7 @@ jobs:
- name: Build external dependencies
if: steps.deps-cache.outputs.cache-hit != 'true'
run:
cargo build -p vit-servicing-station-cli -p vit-servicing-station-server -p jcli -p jormungandr -p explorer
cargo build -p vit-servicing-station-cli -p vit-servicing-station-server -p vit-servicing-station-cli-f10 -p vit-servicing-station-server-f10 -p jcli -p jormungandr -p explorer

- name: Setup Event DB
env:
Expand All @@ -242,7 +248,7 @@ jobs:
# We are excluding cat-dat-service and event-db because we are already running it with Earthly
- name: Build and archive tests
if: steps.archive-cache.outputs.cache-hit != 'true'
run: |
run: |
cargo nextest archive \
--workspace \
--exclude vitup \
Expand All @@ -253,6 +259,10 @@ jobs:
--exclude vit-servicing-station-server \
--exclude vit-servicing-station-tests \
--exclude vit-servicing-station-lib \
--exclude vit-servicing-station-cli-f10 \
--exclude vit-servicing-station-server-f10 \
--exclude vit-servicing-station-tests-f10 \
--exclude vit-servicing-station-lib-f10 \
--exclude cat-data-service \
--exclude event-db \
--exclude wallet-uniffi \
Expand Down Expand Up @@ -388,6 +398,6 @@ jobs:
with:
toolchain: ${{env.RUST_LATEST_STABLE_VERSION}}
components: rustfmt, clippy

- run: rustup component add clippy
- run: scripts/check-fmt.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ result*
.vscode
**/.idea/
.temp/
tests/tmp/

# std
.std
Expand Down
Loading

0 comments on commit 9a25b3b

Please sign in to comment.