Bump h2 from 0.3.11 to 0.3.17 #498
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
on: | |
pull_request: | |
types: [opened, reopened, edited, synchronize] | |
name: "Run CI on Pushes" | |
jobs: | |
rust_tests: | |
name: "Run Rust Tests" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v2 | |
id: cache | |
with: | |
path: ~/.cargo/bin/ | |
key: ${{ runner.os }}-cargo-rust_tests-${{ hashFiles('**/Cargo.lock') }} | |
- name: Set up wasm-pack | |
if: steps.cache.outputs.cache-hit != 'true' | |
uses: actions-rs/install@v0.1 | |
with: | |
crate: wasm-pack | |
- name: Set up just | |
if: steps.cache.outputs.cache-hit != 'true' | |
uses: actions-rs/install@v0.1 | |
with: | |
crate: just | |
- run: just _rust-test | |
js_tests: | |
name: "Run JS Tests" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v2 | |
id: cache | |
with: | |
path: ~/.cargo/bin/ | |
key: ${{ runner.os }}-cargo-js_tests-${{ hashFiles('**/Cargo.lock') }} | |
- name: Set up wasm-pack | |
if: steps.cache.outputs.cache-hit != 'true' | |
uses: actions-rs/install@v0.1 | |
with: | |
crate: wasm-pack | |
- name: Set up just | |
if: steps.cache.outputs.cache-hit != 'true' | |
uses: actions-rs/install@v0.1 | |
with: | |
crate: just | |
- run: just _js-test | |
- run: | | |
curl -Os https://uploader.codecov.io/latest/linux/codecov | |
chmod +x codecov | |
./codecov -t ${CODECOV_TOKEN} | |
clippy_check: | |
name: "Run Clippy Check" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
components: clippy | |
toolchain: stable | |
override: true | |
- uses: actions-rs/clippy-check@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: --all-targets --all-features -- -D warnings | |
cargo_fmt: | |
name: "Run Cargo Format Check" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- run: cargo fmt -- --check | |
benchmark: | |
name: Perform Relative Benchmark | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.GH_API_PAT }} | |
submodules: recursive | |
fetch-depth: 50 # this is to make sure we obtain the target base commit | |
- uses: actions/cache@v2 | |
id: cache | |
with: | |
path: ~/.cargo/bin/ | |
key: ${{ runner.os }}-cargo-benchmark-${{ hashFiles('**/Cargo.lock') }} | |
- name: Set up wasm-pack | |
if: steps.cache.outputs.cache-hit != 'true' | |
uses: actions-rs/install@v0.1 | |
with: | |
crate: wasm-pack | |
- name: Set up just | |
if: steps.cache.outputs.cache-hit != 'true' | |
uses: actions-rs/install@v0.1 | |
with: | |
crate: just | |
- name: Set up criterion | |
if: steps.cache.outputs.cache-hit != 'true' | |
uses: actions-rs/install@v0.1 | |
with: | |
crate: cargo-criterion | |
- name: Setup benchmarks | |
run: | | |
echo "BASE_SHA=$(echo ${{ github.event.pull_request.base.sha }} | cut -c1-8)" >> $GITHUB_ENV | |
echo "HEAD_SHA=$(echo ${{ github.event.pull_request.head.sha }} | cut -c1-8)" >> $GITHUB_ENV | |
echo "BASELINE_JSON=$(mktemp)" >> $GITHUB_ENV | |
echo "CONTENDER_JSON=$(mktemp)" >> $GITHUB_ENV | |
echo "PR_COMMENT=$(mktemp)" >> $GITHUB_ENV | |
- name: Run benchmarks | |
run: | | |
SETUP_REPO="just build-js solo-build-federalist-index" | |
RUN_BENCHMARK="just solo-generate-stats" | |
git checkout ${{ github.event.pull_request.base.sha }} | |
git checkout ${{ github.event.pull_request.head.sha }} -- justfile | |
$SETUP_REPO | |
$RUN_BENCHMARK > ${{ env.BASELINE_JSON }} | |
git stash | |
git checkout ${{ github.event.pull_request.head.sha }} | |
$SETUP_REPO | |
$RUN_BENCHMARK > ${{ env.CONTENDER_JSON }} | |
python3 scripts/compare_stats.py ${{ env.BASELINE_JSON }} ${{ env.CONTENDER_JSON }} > ${{ env.PR_COMMENT }} | |
- name: Debug tempfile contents | |
run: | | |
cat ${{ env.BASELINE_JSON }} | |
cat ${{ env.CONTENDER_JSON }} | |
cat ${{ env.PR_COMMENT }} | |
- name: Set up comment body | |
id: get-comment-body | |
run: | | |
body="$(cat ${{ env.PR_COMMENT }})" | |
body="${body//'%'/'%25'}" | |
body="${body//$'\n'/'%0A'}" | |
body="${body//$'\r'/'%0D'}" | |
echo "::set-output name=body::$body" | |
- name: Find Comment | |
uses: peter-evans/find-comment@v1 | |
id: fc | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-author: 'github-actions[bot]' | |
body-includes: Benchmarks | |
- name: Create or update comment | |
uses: peter-evans/create-or-update-comment@v1 | |
with: | |
comment-id: ${{ steps.fc.outputs.comment-id }} | |
issue-number: ${{ github.event.pull_request.number }} | |
body: | | |
### Benchmarks | |
${{ steps.get-comment-body.outputs.body }} | |
Baseline: **${{ github.event.pull_request.base.sha }}**; Comparison: ${{ github.event.pull_request.head.sha }} | |
edit-mode: replace |