Refactor ci2 #21
Workflow file for this run
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: concrete-optimizer test | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- .github/workflows/concrete_optimizer.yml | |
- compilers/concrete-optimizer/** | |
- backends/** | |
- tools/** | |
push: | |
branches: | |
- 'main' | |
- 'release/*' | |
env: | |
CARGO_TERM_COLOR: always | |
ACTION_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }} | |
SLACK_USERNAME: ${{ secrets.BOT_USERNAME }} | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
concurrency: | |
group: concrete_optimizer-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
jobs: | |
tests: | |
strategy: | |
matrix: | |
runson: ["ubuntu-latest", "aws-mac1-metal", "aws-mac2-metal"] | |
runs-on: ${{ matrix.runson }} | |
env: | |
RUSTFLAGS: -D warnings | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup | |
uses: ./.github/workflows/optimizer_setup | |
- name: Formatting | |
run: | | |
cargo --version | |
cd compilers/concrete-optimizer | |
cargo fmt --check | |
- name: Build | |
run: | | |
cd compilers/concrete-optimizer | |
cargo build --release --all-targets | |
- name: Lint | |
run: | | |
cd compilers/concrete-optimizer | |
cargo clippy --release --all-targets | |
- name: Tests | |
run: | | |
cd compilers/concrete-optimizer | |
cargo test --release --no-fail-fast --all-targets | |
make -C concrete-optimizer-cpp test-ci | |
benchmarks: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup | |
uses: ./.github/workflows/optimizer_setup | |
- name: Run benchmark | |
run: | | |
cd compilers/concrete-optimizer | |
cargo bench -p v0-parameters -- --output-format bencher | tee bench_result.txt | |
- name: Download PR base benchmark data | |
if: ${{ github.event_name == 'pull_request' }} | |
# for artifacts restrictions see https://github.com/actions/download-artifact/issues/3 | |
# for cache restrictions see https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache | |
# and https://github.com/actions/cache/issues/692 | |
uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
workflow_conclusion: "" | |
search_artifacts: true | |
name: ${{ runner.os }}-benchmark | |
if_no_artifact_found: warn | |
path: ./benchmark | |
- name: Save benchmark result to file | |
uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29 # v1.20.3 | |
with: | |
tool: 'cargo' | |
output-file-path: ./compilers/concrete-optimizer/bench_result.txt | |
external-data-json-path: ./benchmark/benchmark-data.json | |
# GitHub API token to make a commit comment | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
# Enable alert commit comment | |
comment-always: true | |
# Enable Job Summary for PRs | |
summary-always: true | |
- name: Upload benchmark data | |
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 | |
with: | |
path: ./benchmark | |
name: ${{ runner.os }}-benchmark |