forked from erigontech/erigon
-
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 erigontech#4 from maticnetwork/upstream-changes
Upstream changes
- Loading branch information
Showing
229 changed files
with
10,158 additions
and
2,994 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,6 @@ | ||
# host OS dedicated user (for docker especially) | ||
ERIGON_USER=erigon | ||
|
||
# UID, GID of user inside docker process which must exist also on host OS | ||
DOCKER_UID=1000 # random number [1001, 10000] chosen arbitrarily for example | ||
DOCKER_GID=1000 # can choose any valid #. 1000 tends to be taken by first user |
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Coverage | ||
on: | ||
push: | ||
branches: | ||
- devel | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: git submodule update --init --recursive --force | ||
|
||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18.x | ||
|
||
- name: install dependencies on Linux | ||
if: runner.os == 'Linux' | ||
run: sudo apt update && sudo apt install build-essential | ||
|
||
- name: run coverage | ||
run: echo "COVERAGE=$(make coverage)" >> $GITHUB_ENV | ||
|
||
- name: set badge color | ||
shell: bash | ||
run: | | ||
if [ ${{ env.COVERAGE }} -lt 40 ] | ||
then | ||
echo "BADGE_COLOR=800000" >> $GITHUB_ENV | ||
elif [ ${{ env.COVERAGE }} -lt 75 ] | ||
then | ||
echo "BADGE_COLOR=696969" >> $GITHUB_ENV | ||
else | ||
echo "BADGE_COLOR=31c653" >> $GITHUB_ENV | ||
fi | ||
- name: create badge | ||
uses: emibcn/badge-action@d6f51ff11b5c3382b3b88689ae2d6db22d9737d1 | ||
with: | ||
label: Coverage | ||
status: ${{ env.COVERAGE }} | ||
color: ${{ env.BADGE_COLOR }} | ||
path: badge.svg | ||
|
||
- name: upload badge to gist | ||
if: > | ||
github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'devel' || | ||
github.event_name != 'workflow_run' && github.ref == 'refs/heads/devel' | ||
uses: andymckay/append-gist-action@1fbfbbce708a39bd45846f0955ed5521f2099c6d | ||
with: | ||
token: ${{ secrets.GIST_TOKEN }} | ||
gistURL: https://gist.githubusercontent.com/revittm/ee38e9beb22353eef6b88f2ad6ed7aa9 | ||
file: badge.svg |
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,75 @@ | ||
name: Hive results | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["CI"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
hive-results: | ||
name: Hive results | ||
runs-on: ubuntu-latest | ||
if: github.event.workflow_run.conclusion != 'skipped' | ||
|
||
permissions: | ||
checks: write | ||
pull-requests: write | ||
actions: read | ||
|
||
steps: | ||
- name: download and extract artifacts | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
run: | | ||
mkdir -p artifacts && cd artifacts | ||
artifacts_url=${{ github.event.workflow_run.artifacts_url }} | ||
gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact | ||
do | ||
IFS=$'\t' read name url <<< "$artifact" | ||
gh api $url > "$name.zip" | ||
unzip -d "$name" "$name.zip" | ||
done | ||
- name: publish hive test results | ||
uses: EnricoMi/publish-unit-test-result-action@v1 | ||
with: | ||
commit: ${{ github.event.workflow_run.head_sha }} | ||
event_file: artifacts/Event File/event.json | ||
event_name: ${{ github.event.workflow_run.event }} | ||
files: "artifacts/**/*.xml" | ||
|
||
- name: set badge color | ||
shell: bash | ||
run: | | ||
case ${{ fromJSON( steps.test-results.outputs.json ).conclusion }} in | ||
success) | ||
echo "BADGE_COLOR=31c653" >> $GITHUB_ENV | ||
;; | ||
failure) | ||
echo "BADGE_COLOR=800000" >> $GITHUB_ENV | ||
;; | ||
neutral) | ||
echo "BADGE_COLOR=696969" >> $GITHUB_ENV | ||
;; | ||
esac | ||
- name: create badge | ||
uses: emibcn/badge-action@d6f51ff11b5c3382b3b88689ae2d6db22d9737d1 | ||
with: | ||
label: Hive | ||
status: '${{ fromJSON( steps.test-results.outputs.json ).formatted.stats.tests }} tests, ${{ fromJSON( steps.test-results.outputs.json ).formatted.stats.runs }} runs: ${{ fromJSON( steps.test-results.outputs.json ).conclusion }}' | ||
color: ${{ env.BADGE_COLOR }} | ||
path: badge.svg | ||
|
||
- name: upload badge to gist | ||
if: > | ||
github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'devel' || | ||
github.event_name != 'workflow_run' && github.ref == 'refs/heads/devel' | ||
uses: andymckay/append-gist-action@1fbfbbce708a39bd45846f0955ed5521f2099c6d | ||
with: | ||
token: ${{ secrets.GIST_TOKEN }} | ||
gistURL: https://gist.githubusercontent.com/revittm/dc492845ba6eb694e6c7279224634b20 | ||
file: badge.svg |
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 |
---|---|---|
|
@@ -77,3 +77,6 @@ go.work | |
docker-compose.*.yml | ||
|
||
dist | ||
.env | ||
coverage.out | ||
|
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,13 +1,6 @@ | ||
[submodule "tests"] | ||
path = tests/testdata | ||
url = https://github.com/ethereum/tests | ||
[submodule "turbo/snapshotsync/snapshothashes/erigon-snapshots"] | ||
path = turbo/snapshotsync/snapshothashes/erigon-snapshots | ||
url = https://github.com/ledgerwatch/erigon-snapshot.git | ||
[submodule "cmd/downloader/trackers/trackerslist"] | ||
path = cmd/downloader/trackers/trackerslist | ||
url = https://github.com/ngosang/trackerslist.git | ||
|
||
[submodule "libmdbx"] | ||
path = libmdbx | ||
url = https://github.com/torquem-ch/libmdbx.git |
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
Oops, something went wrong.