-
Notifications
You must be signed in to change notification settings - Fork 145
99 lines (94 loc) · 3.45 KB
/
concrete_optimizer.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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