auto deploy website #8
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
name: Build Test Results Dashboard | |
on: | |
workflow_dispatch: | |
inputs: | |
runall_params: | |
description: 'Custom runall params' | |
required: false | |
type: string | |
dump_logs: | |
description: 'dump logs' | |
required: false | |
type: boolean | |
verbose: | |
description: 'verbose script logging' | |
type: choice | |
required: false | |
options: | |
- true | |
skip_test: | |
description: 'skip test - check github update' | |
required: false | |
type: boolean | |
ignore_cache: | |
description: 'ignore cache' | |
required: false | |
type: boolean | |
# push: | |
# branches: | |
# - '*' | |
pull_request: | |
types: [opened, reopened, synchronize] | |
# Allows external webhook trigger | |
repository_dispatch: | |
types: | |
- webhook | |
env: | |
FORCE_COLORS: 1 | |
jobs: | |
runall: | |
runs-on: ubuntu-latest | |
steps: | |
- run: curl -sSL https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py | python3 - | |
- run: pip install jq yq | |
- run: which xq | |
- uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
# - uses: actions/checkout@v3 | |
# with: | |
# repository: eth-infinitism/bundler-spec-tests | |
# path: bundler-spec-tests | |
# submodules: true | |
- run: test -d bundler-spec-tests || git clone --recurse-submodules --depth 1 https://github.com/eth-infinitism/bundler-spec-tests | |
name: clone bundler-spec-tests | |
- run: cd bundler-spec-tests && (git describe --tags; git submodule ) | tee .git.status | |
name: check bundler-spec-tests and submodules status | |
# restore cache of bundler-spec-tests, and its submodules | |
- uses: actions/cache@v3 | |
if: ${{ ! inputs.ignore_cache }} | |
with: | |
path: bundler-spec-tests | |
key: ${{ runner.os }}-${{ hashFiles('bundler-spec-tests/pdm.lock', 'bundler-spec-tests/@account-abstraction/contracts/**/*.sol') }} | |
- run: cd bundler-spec-tests; git checkout | |
name: "re-checkout bundler-spec-tests (on top of cache)" | |
#for faster "update-deps" for spec | |
- run: yarn --cwd bundler-spec-tests/spec remove gatsby || echo "already removed" | |
- run: "cd bundler-spec-tests && pdm install && cd @account-abstraction && yarn && yarn compile && cd ../spec && yarn && yarn build" | |
name: update submodules of bundler-spec-tests | |
- run: VERBOSE=${{ inputs.verbose }} ./runall.sh ${{ inputs.runall_params }} | |
if: ${{ ! inputs.skip_test }} | |
name: Run all tests ${{ inputs.runall_params }} | |
- name: "Test summary" | |
run: "grep -r '===.* in ' `find . -path '*build/out*txt'`| sed -e 's/===*//g' " | |
- name: dump logs | |
if: ${{ inputs.dump_logs }} | |
run: for d in build/*/*.log; do echo === $d:; cat $d | perl -pe 's/(?:runbundler-)?(\S+?)(?:-1)?[\s|]+(\S+)/$2 $1 /' | sort ; done | |
- name: Clone and update results repo | |
run: ./update-results.sh out-results | |
- name: npm | |
run: sudo apt -y install nodejs | |
- name: Compile UI | |
run: cd landing-page && npm install && npm run build && mv ../out-results/index.html ../out-results/index-old.html && cp -rf out/* ../out-results/ | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./out-results | |
# Allow one concurrent deployment | |
concurrency: | |
group: "deploy" | |
cancel-in-progress: true | |