Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
213 lines (212 sloc) 6.85 KB
name: CI
on: [push, pull_request]
jobs:
rust:
name: Run Rust benchmark example
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- run: npm ci
- run: npm run build
- name: Save previous data.js
run: |
git checkout gh-pages
cp ./dev/bench/data.js before_data.js
git checkout -
- run: rustup toolchain update nightly && rustup default nightly
- name: Run benchmark
run: cd examples/rust && cargo +nightly bench | tee output.txt
- name: Store benchmark result
uses: ./
with:
name: Rust Benchmark
tool: 'cargo'
output-file-path: examples/rust/output.txt
skip-fetch-gh-pages: true
fail-on-alert: true
- run: node ./scripts/ci_validate_modification.js before_data.js 'Rust Benchmark'
go:
name: Run Go benchmark example
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/setup-go@v1
- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- run: npm ci
- run: npm run build
- name: Save previous data.js
run: |
git checkout gh-pages
cp ./dev/bench/data.js before_data.js
git checkout -
- name: Run benchmark
run: cd examples/go && go test -bench 'BenchmarkFib' | tee output.txt
- name: Store benchmark result
uses: ./
with:
name: Go Benchmark
tool: 'go'
output-file-path: examples/go/output.txt
skip-fetch-gh-pages: true
fail-on-alert: true
- run: node ./scripts/ci_validate_modification.js before_data.js 'Go Benchmark'
benchmarkjs:
name: Run JavaScript benchmark example
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- run: npm ci
- run: npm run build
- name: Save previous data.js
run: |
git checkout gh-pages
cp ./dev/bench/data.js before_data.js
git checkout -
- name: Run benchmark
run: cd examples/benchmarkjs && npm install && node bench.js | tee output.txt
- name: Store benchmark result
uses: ./
with:
name: Benchmark.js Benchmark
tool: 'benchmarkjs'
output-file-path: examples/benchmarkjs/output.txt
skip-fetch-gh-pages: true
fail-on-alert: true
- run: node ./scripts/ci_validate_modification.js before_data.js 'Benchmark.js Benchmark'
pytest-benchmark:
name: Run Pytest benchmark example
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/setup-python@v1
- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- run: npm ci
- run: npm run build
- name: Save previous data.js
run: |
git checkout gh-pages
cp ./dev/bench/data.js before_data.js
git checkout -
- name: Run benchmark
run: |
cd examples/pytest
pip install -r requirements.txt
pytest bench.py --benchmark-json output.json
- name: Store benchmark result
uses: ./
with:
name: Python Benchmark with pytest-benchmark
tool: 'pytest'
output-file-path: examples/pytest/output.json
skip-fetch-gh-pages: true
fail-on-alert: true
- run: node ./scripts/ci_validate_modification.js before_data.js 'Python Benchmark with pytest-benchmark'
google-benchmark-framework:
name: Run Google C++ Benchmark Framework example
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- run: npm ci
- run: npm run build
- name: Save previous data.js
run: |
git checkout gh-pages
cp ./dev/bench/data.js before_data.js
git checkout -
- name: Cache Benchmark library
uses: actions/cache@v1
with:
path: examples/cpp/benchmark
key: ${{ runner.os }}-googlebenchmark-v1.5.0
- name: Run benchmark
run: |
cd examples/cpp
make json
- name: Store benchmark result
uses: ./
with:
name: C++ Benchmark
tool: 'googlecpp'
output-file-path: examples/cpp/benchmark_result.json
skip-fetch-gh-pages: true
fail-on-alert: true
- run: node ./scripts/ci_validate_modification.js before_data.js 'C++ Benchmark'
only-alert-with-cache:
name: Run alert check with actions/cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- run: npm ci
- run: npm run build
- uses: actions/setup-go@v1
- name: Run benchmark
run: cd examples/go && go test -bench 'BenchmarkFib' | tee output.txt
- name: Download previous benchmark data
uses: actions/cache@v1
with:
path: ./cache
key: ${{ runner.os }}-ci-cache-test
- name: Store benchmark result
uses: ./
with:
name: Alert setup example with cache
tool: 'go'
output-file-path: examples/go/output.txt
external-data-json-path: ./cache/benchmark-data.json
github-token: ${{ secrets.GITHUB_TOKEN }}
alert-threshold: '200%'
comment-on-alert: true
fail-on-alert: true
alert-comment-cc-users: '@rhysd'
unit-tests:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- run: npm ci
- run: npm run lint
- run: npm run build
- run: npm run coverage
- name: Apply yamllint
run: |
sudo pip install yamllint
yamllint .github/workflows
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
yml: .codecov.yml
You can’t perform that action at this time.