fix: measure test (#77) #108
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: Push | |
on: | |
push: | |
branches: [ main, dev ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Lint | |
run: make lint | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Actor | |
run: echo ${{ github.actor }} | |
- name: Build | |
run: make build-in-docker | |
- name: Upload binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sweat-jar | |
path: res/sweat_jar.wasm | |
unit-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Unit tests | |
run: make test | |
integration-tests: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Integration tests | |
run: make integration | |
mutation-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install tool | |
run: cargo install --locked cargo-mutants | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Mutation tests | |
run: make mutation | |
measure: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Measure gas | |
run: make measure | |
- name: Upload measure | |
uses: actions/upload-artifact@v3 | |
with: | |
name: measured | |
path: measured.txt | |
push: | |
needs: [ build, lint, unit-tests, integration-tests, measure, mutation-tests ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | |
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | |
- name: Download binary | |
uses: actions/download-artifact@v3 | |
with: | |
name: sweat-jar | |
path: res/ | |
- name: Download measure | |
uses: actions/download-artifact@v3 | |
with: | |
name: measured | |
- name: Commit & Push changes | |
if: ${{ github.actor != 'sweatcoin' }} | |
uses: actions-js/push@master | |
with: | |
message: Updated binary and measure | |
branch: main | |
github_token: ${{ secrets.ACTIONS_TOKEN }} |