Skip to content

Commit a77f00e

Browse files
author
Barnabas Ratki
committed
feature: Bulk trade price pusher
1 parent bf4483f commit a77f00e

47 files changed

Lines changed: 7369 additions & 58 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Check Pyth Lazer Pusher
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- .github/workflows/ci-pyth-lazer-pusher.yml
7+
- apps/pyth-lazer-pusher/**
8+
push:
9+
branches: [main]
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
defaults:
14+
run:
15+
working-directory: apps/pyth-lazer-pusher
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions-rust-lang/setup-rust-toolchain@v1
19+
- name: Format check
20+
run: cargo fmt --all -- --check
21+
if: success() || failure()
22+
- name: Clippy check
23+
run: cargo clippy -p pusher-base -p websocket-delivery -p bulk-pusher -p bulk-trade-cli -p bulk-trade-mock-validator --all-targets -- --deny warnings
24+
if: success() || failure()
25+
- name: Run tests
26+
run: cargo test -p pusher-base -p websocket-delivery -p bulk-pusher -p bulk-trade-cli -p bulk-trade-mock-validator
27+
if: success() || failure()
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build and Push Bulk Trade Pusher Image
2+
on:
3+
push:
4+
tags:
5+
- bulk-trade-pusher-v*
6+
pull_request:
7+
paths:
8+
- "apps/pyth-lazer-pusher/**"
9+
workflow_dispatch:
10+
inputs:
11+
dispatch_description:
12+
description: "Dispatch description"
13+
required: true
14+
type: string
15+
permissions:
16+
contents: read
17+
id-token: write
18+
packages: write
19+
env:
20+
REGISTRY: ghcr.io
21+
IMAGE_NAME: pyth-network/bulk-trade-pusher
22+
jobs:
23+
bulk-trade-pusher-image:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v2
27+
- name: Set image tag to version of the git tag
28+
if: ${{ startsWith(github.ref, 'refs/tags/bulk-trade-pusher-v') }}
29+
run: |
30+
PREFIX="refs/tags/bulk-trade-pusher-"
31+
VERSION="${GITHUB_REF:${#PREFIX}}"
32+
echo "IMAGE_TAG=${VERSION}" >> "${GITHUB_ENV}"
33+
- name: Set image tag to the git commit hash
34+
if: ${{ !startsWith(github.ref, 'refs/tags/bulk-trade-pusher-v') }}
35+
run: |
36+
echo "IMAGE_TAG=${{ github.sha }}" >> "${GITHUB_ENV}"
37+
- name: Log in to the Container registry
38+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
39+
with:
40+
registry: ${{ env.REGISTRY }}
41+
username: ${{ github.actor }}
42+
password: ${{ secrets.GITHUB_TOKEN }}
43+
- name: Extract metadata (tags, labels) for Docker
44+
id: metadata_bulk_trade_pusher
45+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
46+
with:
47+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
48+
- name: Build and push docker image
49+
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
50+
with:
51+
context: .
52+
file: "./apps/pyth-lazer-pusher/bulk-trade-pusher/Dockerfile"
53+
push: ${{ github.event_name != 'pull_request' }}
54+
tags: ${{ steps.metadata_bulk_trade_pusher.outputs.tags }}
55+
labels: ${{ steps.metadata_bulk_trade_pusher.outputs.labels }}

0 commit comments

Comments
 (0)