Skip to content

Add DependencyManager Mithril Aggregator #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 9 additions & 94 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: CI

# do not run workflow twice on PRs
on:
push:
pull_request:
types: [opened, reopened]
on: [push]

jobs:
build-mithril-core:
Expand Down Expand Up @@ -297,95 +294,6 @@ jobs:
path: |
mithril-network/mithril-client/target/doc/

build-mithril-node-poc:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- uses: actions/setup-go@v2
with:
go-version: '1.17.1'

- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-

- uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: clippy, rustfmt
override: true

- name: install mlib
run: make mlib
working-directory: mithril-proto/mithril-node-poc/

- name: Golang Tests
run: go test ./...
working-directory: mithril-proto/mithril-node-poc/

docker-mithril-node-poc:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
needs: [ build-mithril-core, build-mithril-node-poc ]
permissions:
contents: read
packages: write

env:
PUSH_PACKAGES: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/mithril-node-poc
DOCKER_FILE: ./mithril-proto/mithril-node-poc/Dockerfile
CONTEXT: .
GITHUB_REF: ${{ github.ref}}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags:
type=raw,value={{branch}}-{{sha}}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: ${{ env.CONTEXT }}
file: ${{ env.DOCKER_FILE }}
push: ${{ env.PUSH_PACKAGES }}
tags: ${{ steps.meta.outputs.tags }}

docker-mithril-aggregator:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
Expand Down Expand Up @@ -487,7 +395,11 @@ jobs:
generate-publish-docs:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
needs: [ build-mithril-core, build-mithril-aggregator, build-mithril-client ]
needs:
- docker-mithril-aggregator
- docker-mithril-client
- test-mithril-core
- build-test-lab
steps:
- name: Checkout sources
uses: actions/checkout@v2
Expand Down Expand Up @@ -580,6 +492,9 @@ jobs:
run: nix-shell --run '.github/workflows/ci-build.sh'

- name: Test
env:
NETWORK: testnet
URL_SNAPSHOT_MANIFEST: https://storage.googleapis.com/cardano-testnet/snapshots.json
run: nix-shell --run '.github/workflows/ci-test.sh'

terraform:
Expand Down
Loading