-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* CI and docker * cleanup * erc * whoops
- Loading branch information
Showing
12 changed files
with
138 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Check Fortuna | ||
|
||
on: | ||
pull_request: | ||
paths: [fortuna/**] | ||
push: | ||
branches: [main] | ||
paths: [fortuna/**] | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly-2023-07-23 | ||
override: true | ||
- name: Run executor tests | ||
run: cargo test --manifest-path ./fortuna/Cargo.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Build and Push Fortuna Image | ||
on: | ||
push: | ||
tags: | ||
- fortuna-v* | ||
workflow_dispatch: | ||
inputs: | ||
dispatch_description: | ||
description: "Dispatch description" | ||
required: true | ||
type: string | ||
permissions: | ||
contents: read | ||
id-token: write | ||
jobs: | ||
fortuna-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set image tag to version of the git tag | ||
if: ${{ startsWith(github.ref, 'refs/tags/fortuna-v') }} | ||
run: | | ||
PREFIX="refs/tags/fortuna-" | ||
VERSION="${GITHUB_REF:${#PREFIX}}" | ||
echo "IMAGE_TAG=${VERSION}" >> "${GITHUB_ENV}" | ||
- name: Set image tag to the git commit hash | ||
if: ${{ !startsWith(github.ref, 'refs/tags/fortuna-v') }} | ||
run: | | ||
echo "IMAGE_TAG=${{ github.sha }}" >> "${GITHUB_ENV}" | ||
- uses: aws-actions/configure-aws-credentials@8a84b07f2009032ade05a88a28750d733cc30db1 | ||
with: | ||
role-to-assume: arn:aws:iam::192824654885:role/github-actions-ecr | ||
aws-region: eu-west-2 | ||
- uses: docker/login-action@v2 | ||
with: | ||
registry: public.ecr.aws | ||
env: | ||
AWS_REGION: us-east-1 | ||
- run: | | ||
DOCKER_BUILDKIT=1 docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f fortuna/Dockerfile . | ||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG | ||
env: | ||
ECR_REGISTRY: public.ecr.aws | ||
ECR_REPOSITORY: pyth-network/fortuna |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
ARG RUST_VERSION=1.66.1 | ||
|
||
FROM rust:${RUST_VERSION} AS build | ||
|
||
# Set default toolchain | ||
RUN rustup default nightly-2023-07-23 | ||
|
||
# Build | ||
WORKDIR /src | ||
COPY fortuna fortuna | ||
|
||
WORKDIR /src/fortuna | ||
|
||
RUN --mount=type=cache,target=/root/.cargo/registry cargo build --release | ||
|
||
|
||
FROM rust:${RUST_VERSION} | ||
# Copy artifacts from other images | ||
COPY --from=build /src/fortuna/target/release/fortuna /usr/local/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters