Skip to content

Commit

Permalink
Merge pull request #2 from ethereum-lists/master
Browse files Browse the repository at this point in the history
Sync fork
  • Loading branch information
paouvrard authored Feb 1, 2024
2 parents 24e545f + 2d63831 commit 68961d7
Show file tree
Hide file tree
Showing 2,260 changed files with 35,413 additions and 4,879 deletions.
25 changes: 0 additions & 25 deletions .github/ISSUE_TEMPLATE/add-new-chain---network-id.md

This file was deleted.

8 changes: 0 additions & 8 deletions .github/ISSUE_TEMPLATE/other.md

This file was deleted.

7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: gradle
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 3
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.1
with:
submodules: recursive

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41

- name: Check changed files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
./gradlew clean run --args="verbose singleChainCheck $file"
done
- name: Build
run: |
./gradlew run
37 changes: 37 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build
on:
push:
branches: [ master ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.1
with:
submodules: recursive
- name: Build
run: |
./gradlew run
- name: Set Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Run yarn install
uses: borales/actions-yarn@v4
with:
dir: 'website'
cmd: install # will run `yarn install` command
- name: Run yarn build
uses: borales/actions-yarn@v4
with:
dir: 'website'
cmd: run build # will run `yarn test` command
- name: Merge
run: |
cp -a output/. website/public/
- name: Deploy
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
branch: gh-pages
folder: website/public
15 changes: 15 additions & 0 deletions .github/workflows/post_merge_comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
on:
pull_request_target:
types: [closed]
jobs:
comment_on_merged_pr:
if: github.event.pull_request.merged
runs-on: ubuntu-latest
name: Comment after PR merge
steps:
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: |
PR merged - please consider contributing some funds to lists.eth
141 changes: 141 additions & 0 deletions .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
name: Run PR Checks

on:
pull_request:

jobs:
validate_icons:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: nrwl/nx-set-shas@v3
id: last_successful_commit_push
with:
main-branch-name: master
workflow-id: 'pr_checks.yml'

- name: Get changed icons
id: changed-icons
uses: tj-actions/changed-files@v41
with:
files: _data/icons/*.json
base_sha: ${{ steps.last_successful_commit_push.outputs.base }}

- name: Get changed icon blobs
id: changed-icon-blobs
uses: tj-actions/changed-files@v41
with:
files: _data/iconsDownload/*
base_sha: ${{ steps.last_successful_commit_push.outputs.base }}

- run: sudo apt-get -y install jq curl exiftool

- name: Verify the changed icons
if: steps.changed-icons.outputs.any_changed == 'true'
run: |
set -euo pipefail
BAD=0
CHANGED_ICON_BLOBS=(${{ steps.changed-icon-blobs.outputs.all_changed_files }})
for CHANGED_FILE in ${{ steps.changed-icons.outputs.all_changed_files }}; do
echo "Checking icon $CHANGED_FILE"
URL=$(cat "$CHANGED_FILE" | jq '.[0].url' -r)
if [[ "$URL" =~ ^ipfs://([A-Za-z0-9]+)$ ]]; then
IPFS_HASH=${BASH_REMATCH[1]}
if [[ "${CHANGED_ICON_BLOBS[*]} " =~ "_data/iconsDownload/$IPFS_HASH " ]]; then
TARGET_FILE="_data/iconsDownload/$IPFS_HASH"
else
echo "Trying to download the image..."
TARGET_FILE=icon
curl -Lo icon "https://cloudflare-ipfs.com/ipfs/$IPFS_HASH" 2>/dev/null
fi
METADATA=$(exiftool $TARGET_FILE -json)
SCHEMA_WIDTH=$(cat "$CHANGED_FILE" | jq '.[0].width' -r)
SCHEMA_HEIGHT=$(cat "$CHANGED_FILE" | jq '.[0].height' -r)
SCHEMA_TYPE=$(cat "$CHANGED_FILE" | jq '.[0].format' -r)
META_WIDTH=$(echo "$METADATA" | jq '.[0].ImageWidth' -r)
META_HEIGHT=$(echo "$METADATA" | jq '.[0].ImageHeight' -r)
META_TYPE=$(echo "$METADATA" | jq '.[0].FileTypeExtension' -r)
if [ "$SCHEMA_WIDTH" != "$META_WIDTH" ]; then
echo "Expected width $SCHEMA_WIDTH, got $META_WIDTH"
BAD=1
fi
if [ "$SCHEMA_HEIGHT" != "$META_HEIGHT" ]; then
echo "Expected height $SCHEMA_HEIGHT, got $META_HEIGHT"
BAD=1
fi
case "$SCHEMA_TYPE" in
png)
if [ "$META_TYPE" != "png" ]; then
echo "Expected type png, got $META_TYPE"
BAD=1
fi
;;
jpg)
if [ "$META_TYPE" != "jpg" ]; then
echo "Expected type jpg, got $META_TYPE"
BAD=1
fi
;;
svg)
if [ "$META_TYPE" != "svg" ]; then
echo "Expected type svg, got $META_TYPE"
BAD=1
fi
;;
*)
echo "Expected type png, jpg, or svg, got $SCHEMA_TYPE"
BAD=1
;;
esac
else
echo "Expected an IPFS URL, got $URL"
BAD=1
fi
done
exit $BAD
validate_formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: nrwl/nx-set-shas@v3
id: last_successful_commit_push
with:
main-branch-name: master
workflow-id: 'pr_checks.yml'

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
with:
files: _data/*/*.json
base_sha: ${{ steps.last_successful_commit_push.outputs.base }}

- run: sudo npm i -g prettier

- name: Verify the changed icons
if: steps.changed-files.outputs.any_changed == 'true'
run: |
set -euo pipefail
BAD=0
for CHANGED_FILE in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "Checking $CHANGED_FILE"
diff -u "$CHANGED_FILE" <(prettier "$CHANGED_FILE")
done
21 changes: 21 additions & 0 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Run prettier

on:
push:

jobs:
prettier:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v2
- uses: actions/cache@v2
name: Configure npm caching
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/workflows/prettier.yml') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Run prettier
run: |-
npx prettier --check '_data/*/*.json'
26 changes: 26 additions & 0 deletions .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Automatic Rebase
on:
issue_comment:
types: [created]
jobs:
rebase:
name: Rebase
runs-on: ubuntu-latest
if: >-
github.event.issue.pull_request != '' &&
(
contains(github.event.comment.body, '/rebase') ||
contains(github.event.comment.body, '/autosquash')
)
steps:
- name: Checkout the latest code
uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
- name: Automatic Rebase
uses: cirrus-actions/rebase@1.7
with:
autosquash: ${{ contains(github.event.comment.body, '/autosquash') || contains(github.event.comment.body, '/rebase-autosquash') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *'

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v4
with:
stale-issue-message: 'This issue has no activity in a while - it will be closed soon.'
exempt-issue-labels: enhancement
stale-pr-message: 'This PR has no activity in a while - it will be closed soon.'
days-before-stale: 42
days-before-close: 7
24 changes: 24 additions & 0 deletions .github/workflows/validate_json.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Check JSON Schema

on:
push:
pull_request:

jobs:
validate_json:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v2
- uses: actions/cache@v2
name: Configure npm caching
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/workflows/validate_json.yml') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Run JSON Validation
working-directory: ./tools
run: |-
npm install
node schemaCheck.js
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,13 @@ _site
.jekyll-metadata
.DS_Store
.env
node_modules
node_modules
.idea
output
.gradle
model/bin
model/build
processor/bin
processor/build
httpsloader/build
httpsloader/bin
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "website"]
path = website
url = https://github.com/FrederikBolding/chainlist.git
1 change: 1 addition & 0 deletions .jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jdk: openjdk11
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Using Prettier for JSON files only in _data

# Command to format all existing JSON files
# npx prettier --write --ignore-unknown _data

model
processor
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": false
}
Loading

0 comments on commit 68961d7

Please sign in to comment.