Skip to content

Commit

Permalink
chore: introduce s3 GitHub workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mrekucci committed Apr 23, 2024
1 parent abc057e commit 240a2e7
Show file tree
Hide file tree
Showing 10 changed files with 377 additions and 277 deletions.
192 changes: 192 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
#name: mev-commit-ci
#
#on:
# push:
# branches:
# - main
# pull_request:
# branches:
# - main
#
#jobs:
# commitlint:
# name: Check Commit Message
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout Code
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
#
# - name: Install required dependencies
# run: |
# sudo apt-get update
# sudo apt-get install -y git curl
# curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
# sudo DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs
#
# - name: Print versions
# run: |
# git --version
# node --version
# npm --version
# npx commitlint --version
#
# - name: Install commitlint
# run: |
# npm install conventional-changelog-conventionalcommits
# npm install --save-dev @commitlint/config-conventional
# npm install commitlint@latest
#
# - name: Validate current commit (last commit) message
# if: github.event_name == 'push'
# run: npx commitlint --last --verbose
#
# - name: Validate PR commit messages
# if: github.event_name == 'pull_request'
# run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
#
# go-modules:
# name: Test and Build Go Modules
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout Code
# uses: actions/checkout@v4
# with:
# submodules: recursive
#
# - name: Setup Cache
# uses: actions/cache@v4
# with:
# path: |
# ~/go/pkg/mod
# ~/.cache/go-build
# **/go.work.sum
# key: ${{ runner.os }}-go-${{ hashFiles('**/go.work.sum') }}
# restore-keys: ${{ runner.os }}-go-
#
# - name: Setup Go
# uses: actions/setup-go@v5
# with:
# go-version: 1.22
# check-latest: true
# cache-dependency-path: go.work.sum
#
# - name: Workspace Modules
# run: |
# echo $(go list -f '{{.Dir}}' -m)
# echo "GO_LINT_DIRS=$(go list -f '{{.Dir}}/...' -m | grep -v '/external/geth' | tr '\n' ' ')" >> $GITHUB_ENV
#
# - name: Run Gofmt
# run: go list -f '{{.Dir}}' -m | xargs gofmt -d -e -l
#
# - name: Run Tidy
# run: go list -f '{{.Dir}}' -m | xargs -L1 go mod tidy -C
#
# - name: Run Sync
# run: go work sync
#
# - name: Run Lint
# uses: golangci/golangci-lint-action@v4
# with:
# version: v1.57.2
# args: --timeout 15m --verbose ${{ env.GO_LINT_DIRS }}
# skip-cache: true # TODO(mrekucci): remove when the following issue is solved https://github.com/golangci/golangci-lint-action/issues/135#issuecomment-2039548548
#
# - name: Run Build
# run: go list -f '{{.Dir}}/...' -m | xargs go build
#
# # TODO(mrekucci): Re-enable /external/geth module when tests are passing.
# - name: Run Test
# run: go list -f '{{.Dir}}/...' -m | grep -v '/external/geth' | xargs go test -short -race
#
# foundry:
# name: Foundry Checks and Reports
# runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: contracts
#
# steps:
# - name: Checkout Code
# uses: actions/checkout@v4
# with:
# submodules: recursive
#
# - name: Install Foundry
# uses: foundry-rs/foundry-toolchain@v1
#
# - name: Print versions
# run: |
# git --version
# node --version
# npm --version
# forge --version
#
# - name: Run Tests
# run: forge test -vvv --via-ir
#
# - name: Run Snapshot
# run: forge snapshot --via-ir
#
# - name: Run Coverage
# run: forge coverage --ir-minimum
#
# contracts:
# name: Test and Build Contracts Scripts
# runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: contracts
#
# strategy:
# matrix:
# node-version: [ 18.x, 20.x ] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
#
# steps:
# - name: Checkout Code
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
#
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node-version }}
# cache-dependency-path: ./contracts/package-lock.json
# cache: npm
#
# - name: Install Foundry
# uses: foundry-rs/foundry-toolchain@v1
#
# - name: Install Hardhat
# run: npm install -g hardhat
#
# - name: Install Dependencies
# run: npm install
#
# - name: Print versions
# run: |
# git --version
# node --version
# npm --version
# forge --version
#
# - name: Build
# run: npm run build --if-present
#
# - name: Install abigen
# run: |
# sudo add-apt-repository -y ppa:ethereum/ethereum
# sudo apt-get update
# sudo apt-get install -y ethereum
# abigen --version
#
# - name: Check ABI Parity
# run: |
# bash script.sh
# git checkout ${{ github.event.pull_request.head.ref }}
# git diff --name-only --exit-code .
# working-directory: contracts-abi
69 changes: 69 additions & 0 deletions .github/workflows/infrstructure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#name: mev-commit-infrastructure
#
#on:
# workflow_run:
# workflows: ["mev-commit-ci"]
# types:
# - completed
#
#jobs:
# deploy_and_test:
# name: Deploy and Test mev-commit Minimal Infrastructure
# runs-on: ubuntu-latest
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# submodules: recursive
# ref: ${{ github.event.workflow_run.head_branch }}
#
# - name: Install jq
# run: |
# sudo apt-get update
# sudo apt-get install -y jq
#
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
#
# - name: Setup Docker Compose
# run: |
# sudo rm $(which docker-compose)
# curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# sudo chmod +x /usr/local/bin/docker-compose
#
# - name: Build and Start Services
# run: ./mev-commit-cli.sh start minimal
#
# - name: Check Service Endpoints
# run: |
# ips=("172.29.18.2" "172.29.18.3" "172.29.18.4")
#
# for ip in "${ips[@]}"; do
# echo "Checking service at $ip"
#
# attempts=0
# success=false
# while [ $attempts -lt 6 ]; do
# response=$(curl -k -s "https://$ip:13523/topology")
# bidders=$(echo "$response" | jq '.connected_peers.bidders | length')
# providers=$(echo "$response" | jq '.connected_peers.providers | length')
# if [[ -n "$response" && "$bidders" -gt 0 || "$providers" -gt 0 ]]; then
# echo "Service at $ip is OK"
# success=true
# break
# else
# echo "Service check failed for $ip. Retrying in 30 seconds..."
# attempts=$(( $attempts + 1 ))
# sleep 30
# fi
# done
#
# if [ "$success" == "false" ]; then
# echo "Service check failed for $ip after 3 attempts, failing"
# exit 1
# fi
# done
#
# - name: Stop Services
# run: ./mev-commit-cli.sh stop minimal
Loading

0 comments on commit 240a2e7

Please sign in to comment.