Skip to content

Commit

Permalink
Merge pull request #542 from blxdyx/alpha5
Browse files Browse the repository at this point in the history
Alpha5
  • Loading branch information
setunapo authored Oct 29, 2024
2 parents d39b982 + bba5d11 commit 80f2881
Show file tree
Hide file tree
Showing 763 changed files with 359,573 additions and 193,341 deletions.
31 changes: 27 additions & 4 deletions .github/workflows/ci-cd-main-branch-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,22 @@ on:
workflow_dispatch:

jobs:
define_matrix:
runs-on: ubuntu-latest
outputs:
os: ${{ steps.os.outputs.os }}

steps:
- name: Define os
id: os
run: echo 'os=ubuntu-latest' >> "$GITHUB_OUTPUT"

Build:
runs-on: ubuntu-22.04
needs: define_matrix
runs-on: ${{ needs.define_matrix.outputs.os }}
timeout-minutes: 45
outputs:
docker_build_tag: ${{ steps.built_tag_export.outputs.docker_build_tag }}

steps:
- name: Fast checkout git repository
Expand Down Expand Up @@ -115,9 +127,20 @@ jobs:
--push \
--platform linux/amd64,linux/arm64 .
- name: Print docker images published
- name: export and print docker build tag
id: built_tag_export
env:
BUILD_VERSION: "main-${{ steps.getCommitId.outputs.short_commit_id }}"
run: |
echo "docker_build_tag=${{ env.BUILD_VERSION }}" >> $GITHUB_OUTPUT
echo The following docker images have been published:
echo "${{ env.DOCKERHUB_REPOSITORY }}:main-${{ steps.getCommitId.outputs.short_commit_id }}"
echo "${{ env.DOCKERHUB_REPOSITORY }}:main-${{ env.BUILD_VERSION }}"
echo "${{ env.DOCKERHUB_REPOSITORY }}:main-latest"
run-kurtosis-assertoor:
needs: [define_matrix, Build]
uses: erigontech/erigon/.github/workflows/test-kurtosis-assertoor.yml@main
with:
checkout_ref: ${{ github.sha }}
os: ${{ needs.define_matrix.outputs.os }}
docker_build_tag: ${{ needs.Build.outputs.docker_build_tag }}
133 changes: 0 additions & 133 deletions .github/workflows/ci-cd-main-branch-docker-images2.yml

This file was deleted.

22 changes: 6 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ on:
push:
branches:
- main
- erigon2
- 'release/**'
pull_request:
branches:
- main
- erigon2
- 'release/**'
- '**'
types:
- opened
- reopened
Expand All @@ -19,7 +16,11 @@ on:

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ !contains(fromJSON('[
"refs/heads/release/2.60",
"refs/heads/release/2.61",
"refs/heads/main"
]'), github.ref) }}

jobs:
tests:
Expand Down Expand Up @@ -56,17 +57,6 @@ jobs:
echo >&2 "Reproducible build broken"; cat erigon1.sha256; cat erigon2.sha256; exit 1
fi
- name: Install golangci-lint
if: runner.os == 'Linux'
uses: golangci/golangci-lint-action@v6
with:
version: v1.59.1
args: --help

- name: Lint
if: runner.os == 'Linux'
run: make lint

- name: Test
run: make test

Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/docker-image-remove.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Remove docker image
run-name: Request to remove erigontech/erigon:${{ inputs.docker_image_tag }} by @${{ github.actor }}

env:
DOCKERHUB_REPOSITORY: "erigontech/erigon"
API_URL: "https://hub.docker.com/v2/repositories/erigontech/erigon/tags"

on:
push:
branches-ignore:
- '**'
workflow_dispatch:
inputs:
docker_image_tag:
required: true
type: string
default: 'not_yet_defined'
description: 'Docker image tag to remove from hub.docker.com. Works only for erigontech/erigon'

jobs:

build-release:
runs-on: ubuntu-latest
timeout-minutes: 15
name: Remove docker image

steps:

- name: Run API Call
env:
TOKEN: ${{ secrets.ORG_DOCKERHUB_ERIGONTECH_TOKEN }}
run: |
output_code=$(curl --write-out %{http_code} --output curl-output.log \
-s -X DELETE -H "Accept: application/json" \
-H "Authorization: JWT ${{ env.TOKEN }}" \
${{ env.API_URL }}/${{ inputs.docker_image_tag }} )
if [ $output_code -ne 204 ]; then
echo "ERROR: failed to remove docker image ${{ env.DOCKERHUB_REPOSITORY }}:${{ inputs.docker_image_tag }}"
echo "ERROR: API response: $(cat curl-output.log)."
exit 1
else
echo "SUCCESS: docker image ${{ env.DOCKERHUB_REPOSITORY }}:${{ inputs.docker_image_tag }} removed."
exit 0
fi
4 changes: 1 addition & 3 deletions .github/workflows/hive-nightly.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: Hive (Nightly)

on:
# schedule:
# - cron: "0 01 * * *" # run at 1 am UTC every day
workflow_dispatch:

jobs:
hive:
hive-nightly:
runs-on: ubuntu-latest
steps:
- uses: AutoModality/action-clean@v1
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Lint
on:
push:
branches:
- main
- 'release/**'
pull_request:
branches:
- main
- 'release/**'
types:
- opened
- reopened
- synchronize
- ready_for_review
workflow_dispatch:

jobs:
lint:
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: '1.22'

- name: Install golangci-lint
if: runner.os == 'Linux'
uses: golangci/golangci-lint-action@v6
with:
version: v1.59.1
args: --help

- name: Lint
if: runner.os == 'Linux'
run: make lint
18 changes: 1 addition & 17 deletions .github/workflows/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,15 @@ on:
workflow_dispatch:

jobs:
# check-snap-modifications:
# runs-on: ubuntu-24.04
# outputs:
# modified: ${{ steps.check-modified.outputs.modified }}
#
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 2 # Ensures we fetch enough history to compare
#
# - name: Is erigontech/erigon-snapshot updated in go.mod # if not, pipeline should exit because grep exit code >0 when no match
# run: |
# git diff HEAD~1 HEAD -- go.mod | grep 'github.com/erigontech/erigon-snapshot'

ManifestCheck:
# needs: check-snap-modifications
if: github.event.pull_request.draft == false
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- run: sudo apt update && sudo apt install build-essential
go-version: '1.23'
- run: make downloader
- run: echo $ModModified
- run: ./build/bin/downloader manifest-verify --chain bsc
Expand Down
Loading

0 comments on commit 80f2881

Please sign in to comment.