-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2212d17
commit 6ba7132
Showing
4 changed files
with
49 additions
and
100 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
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 |
---|---|---|
@@ -1,62 +1,49 @@ | ||
name: CI suite | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
branches: [main] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
branches: [main] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Read toolchain file | ||
id: rust-toolchain | ||
run: | | ||
RUST_TOOLCHAIN=$(grep 'channel' rust-toolchain.toml | awk '{split($0,a," = "); print a[2]}' | tr -d '"') | ||
echo "RUST_TOOLCHAIN=$RUST_TOOLCHAIN" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- name: Install toolchain | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ steps.rust-toolchain.outputs.RUST_TOOLCHAIN }} | ||
|
||
- name: Rust cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
|
||
- name: Build | ||
run: cargo build --all-targets --all-features --all --verbose | ||
|
||
- name: Run tests | ||
run: cargo test --all --verbose | ||
|
||
- name: Validate config | ||
run: cargo run config example.config.toml | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install toolchain | ||
uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
components: rustfmt, clippy | ||
|
||
- name: Rust cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
|
||
- name: Check format | ||
run: cargo +nightly fmt --all --check | ||
|
||
- name: Check clippy | ||
run: cargo +nightly clippy --all-targets --all-features --all --verbose -- -D warnings |
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 |
---|---|---|
@@ -1,56 +1,51 @@ | ||
name: docker | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
branches: | ||
- main | ||
tags: | ||
- v* | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
IMAGE_NAME: ${{ github.repository_owner}}/mev-rs | ||
|
||
jobs: | ||
extract-version: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Extract version (if main) | ||
if: github.event.ref == 'refs/heads/main' | ||
run: | | ||
echo "VERSION=latest" >> $GITHUB_ENV | ||
- name: Extract version (if tagged release) | ||
if: startsWith(github.event.ref, 'refs/tags') | ||
run: | | ||
echo "VERSION=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV | ||
outputs: | ||
VERSION: ${{ env.VERSION }} | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Extract version (if main) | ||
if: github.event.ref == 'refs/heads/main' | ||
run: | | ||
echo "VERSION=latest" >> $GITHUB_ENV | ||
- name: Extract version (if tagged release) | ||
if: startsWith(github.event.ref, 'refs/tags') | ||
run: | | ||
echo "VERSION=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV | ||
outputs: | ||
VERSION: ${{ env.VERSION }} | ||
build-docker: | ||
name: build-docker-${{ matrix.binary }} | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
binary: [x86_64] | ||
include: | ||
- profile: maxperf | ||
|
||
needs: [extract-version] | ||
env: | ||
VERSION: ${{ needs.extract-version.outputs.VERSION }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME}} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
tags: ${{ env.IMAGE_NAME }}:${{ env.VERSION }} | ||
name: build-docker-${{ matrix.binary }} | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
binary: [x86_64] | ||
include: | ||
- profile: maxperf | ||
needs: [extract-version] | ||
env: | ||
VERSION: ${{ needs.extract-version.outputs.VERSION }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME}} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
tags: ${{ env.IMAGE_NAME }}:${{ env.VERSION }} |
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