test: run benchmarks in Travis CI and deploy the results

This commit is contained in:
Jędrzej Boczar 2020-02-17 09:28:00 +01:00
parent b7ed91d9f0
commit d14254124a
2 changed files with 21 additions and 3 deletions

View File

@ -5,12 +5,15 @@ python: "3.6"
before_install: before_install:
- sudo apt-get update - sudo apt-get update
- sudo apt-get -y install verilator libevent-dev libjson-c-dev - sudo apt-get -y install verilator libevent-dev libjson-c-dev
- pip install pexpect - pip install pexpect numpy matplotlib pandas jinja2
install: install:
# Get Migen / LiteX / Cores # Get Migen / LiteX / Cores
- wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py - wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py
- python3 litex_setup.py init install - python3 litex_setup.py init install
# litex_setup.py fails for litedram, which has already been cloned by Travis
# now install the local litedram so that it is available for benchmarks script
- python3 -m pip install .
before_script: before_script:
# Get RISC-V toolchain # Get RISC-V toolchain
@ -58,3 +61,19 @@ jobs:
- env: SDRAM_MODULE=MT40A1G8 - env: SDRAM_MODULE=MT40A1G8
- env: SDRAM_MODULE=MT40A512M16 - env: SDRAM_MODULE=MT40A512M16
- stage: Benchmarks
script:
- python3 -m test.run_benchmarks test/benchmarks.yml --results-cache cache.json --html
# move benchmark artifacts to gh-pages/ directory that will be pushed to gh-pages branch
- mkdir -p gh-pages
- mv html/summary.html gh-pages/index.html
- mv cache.json gh-pages/cache.json
- touch gh-pages/.nojekyll
deploy:
provider: pages
skip_cleanup: true
token: $GITHUB_TOKEN
keep_history: true
local_dir: gh-pages
on:
branch: master

View File

@ -220,8 +220,7 @@ def get_git_file_path(filename):
def get_git_revision_hash(short=False): def get_git_revision_hash(short=False):
short = ['--short'] if short else [] short = ['--short'] if short else []
# cmd = ['git', 'rev-parse', *short, 'HEAD'] cmd = ['git', 'rev-parse', *short, 'HEAD']
cmd = ['git', 'rev-parse', *short, 'origin/master']
proc = subprocess.run(cmd, stdout=subprocess.PIPE, cwd=os.path.dirname(__file__)) proc = subprocess.run(cmd, stdout=subprocess.PIPE, cwd=os.path.dirname(__file__))
return proc.stdout.decode().strip() if proc.returncode == 0 else '' return proc.stdout.decode().strip() if proc.returncode == 0 else ''