fork/rust_serialization_benchmark

git clone https://git.julia.blue/fork/rust_serialization_benchmark

David KoloskiFix workflow dispatch branch392e8bc

master
2.1 KiB85 linesraw
1name: bench
2
3on:
4  workflow_dispatch:
5  push:
6    branches:
7      - master
8    paths:
9      - 'Cargo.toml'
10      - 'benches/**'
11      - 'src/**'
12
13env:
14  CI: true
15
16jobs:
17  build:
18    name: bench
19    strategy:
20      matrix:
21        platform: [ubuntu-latest]
22    runs-on: ${{ matrix.platform }}
23    steps:
24      - uses: actions/checkout@v3
25        with:
26          fetch-depth: 1
27          submodules: true
28
29      - uses: actions-rs/toolchain@v1
30        with:
31          toolchain: nightly
32          override: true
33          components: rust-src
34
35      - uses: Swatinem/rust-cache@v2
36
37      - name: Add wasm32 target
38        run: rustup target add wasm32-unknown-unknown
39
40      - name: Install Trunk
41        uses: baptiste0928/cargo-install@v2
42        with:
43          crate: trunk
44
45      - name: bench
46        if: "!contains(github.event.head_commit.message, '[no-bench]')"
47        shell: bash
48        run: |
49
50          wget "https://github.com/protocolbuffers/protobuf/releases/download/v23.3/protoc-23.3-linux-x86_64.zip" -O protoc.zip
51          unzip protoc.zip
52          chmod +x bin/protoc
53          mv bin/protoc /usr/local/bin
54
55          wget "https://github.com/google/flatbuffers/releases/download/v23.5.26/Linux.flatc.binary.clang++-12.zip" -O flatbuffers
56          unzip flatbuffers
57          chmod +x flatc
58          mv flatc /usr/local/bin
59
60          sudo apt-get install -y capnproto libprotobuf-dev
61
62          git config --global user.name github-actions
63          git config --global user.email github-actions@github.com
64
65          cargo run -p bencher
66
67          git add -A benchmark_results
68          git add README.md
69          git commit -m "[gh-actions] Update benchmarks"
70
71      - name: Push changes
72        uses: ad-m/github-push-action@master
73        with:
74          github_token: ${{ secrets.GITHUB_TOKEN }}
75          branch: ${{ github.ref }}
76
77      - name: Build Pages
78        shell: bash
79        run: cd pages && trunk --config Trunk.prod.toml build --release --filehash=false && cd ..
80
81      - name: Deploy Pages
82        uses: peaceiris/actions-gh-pages@v3
83        with:
84          github_token: ${{ secrets.GITHUB_TOKEN }}
85          publish_dir: ./pages/dist