forked from stratum-mining/benchmarking-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request stratum-mining#41 from Shourya742/workflow
Add workflow file
- Loading branch information
Showing
1 changed file
with
86 additions
and
0 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,86 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
clippy: | ||
name: Clippy Lint | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
|
||
- name: Run Clippy | ||
run: cargo clippy --workspace --all-targets -- -D warnings | ||
|
||
fmt: | ||
name: Rust Format Check | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
|
||
- name: Run rustfmt | ||
run: cargo fmt -- --check | ||
|
||
docker_build: | ||
name: Docker Build | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker (Ubuntu) | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y docker.io | ||
sudo systemctl start docker | ||
sudo systemctl enable docker | ||
- name: Set up Docker (macOS) | ||
if: runner.os == 'macOS' | ||
run: | | ||
brew install --cask docker | ||
open /Applications/Docker.app | ||
while ! docker system info > /dev/null 2>&1; do sleep 1; done | ||
- name: Build Docker Images | ||
run: | | ||
docker build -t log-server ./log-server | ||
docker build -t pools-latency-calculator ./pools-latency-calculator | ||
docker build -t sv1-custom-proxy ./sv1-custom-proxy | ||
docker build -t sv2-custom-proxy ./sv2-custom-proxy | ||
docker build -f sv1-public-pool.dockerfile -t sv1-public-pool . | ||
docker build -f template-provider.dockerfile -t template-provider . | ||
docker build -f sv2-roles.dockerfile -t sv2-roles . | ||
docker build -f pools-latency-calculator.dockerfile -t pools-latency-calculator . |