Files
concrete/.github/workflows/optimizer.yml
dependabot[bot] 3d757eee7a chore(ci): bump actions/upload-artifact from 4.3.4 to 4.3.6
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.4 to 4.3.6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](0b2256b8c0...834a144ee9)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-12 14:41:50 +02:00

103 lines
3.2 KiB
YAML

name: Optimizer - Tests
on:
workflow_call:
workflow_dispatch:
secrets:
CONCRETE_CI_SSH_PRIVATE:
required: true
CONCRETE_ACTIONS_TOKEN:
required: true
concurrency:
group: optimizer-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
env:
CARGO_TERM_COLOR: always
jobs:
tests:
strategy:
matrix:
os: [ubuntu-20.04, macos-11]
runs-on: ${{ matrix.os }}
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: "Setup"
uses: ./.github/workflows/optimizer_setup
with:
ssh_private_key: ${{ secrets.CONCRETE_CI_SSH_PRIVATE }}
- name: Formatting
run: |
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
if: matrix.os == 'ubuntu-20.04'
run: |
cd compilers/concrete-optimizer
cargo test --release --no-fail-fast --all-targets
make -C concrete-optimizer-cpp test-ci
benchmarks:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: "Setup"
uses: ./.github/workflows/optimizer_setup
with:
ssh_private_key: ${{ secrets.CONCRETE_CI_SSH_PRIVATE }}
- 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@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
path: ./benchmark
name: ${{ runner.os }}-benchmark