Skip to content

Merge pull request #573 from candy-lang/change-assign-author-action #976

Merge pull request #573 from candy-lang/change-assign-author-action

Merge pull request #573 from candy-lang/change-assign-author-action #976

Workflow file for this run

name: Compiler
on:
push:
branches: [main]
pull_request:
env:
RUST_VERSION: nightly
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e
with:
toolchain: ${{ env.RUST_VERSION }}
components: clippy, rustfmt
- uses: Swatinem/[email protected]
# Compiler
- name: 'Compiler: clippy'
run: cargo clippy -- --deny warnings
- name: 'Compiler: test'
run: cargo test --workspace
- name: 'Compiler: fmt'
run: cargo fmt --check
# Core
- name: 'Core: run'
run: cargo run --release -- check packages/Core/_.candy
# fuzzing:
# name: Fuzzing
# runs-on: ubuntu-latest
# steps:
# - uses: actions/[email protected]
# - uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e
# with:
# toolchain: ${{ env.RUST_VERSION }}
# - uses: Swatinem/[email protected]
# - run: cargo run --release -- fuzz packages/Benchmark.candy
benchmark:
name: Benchmark
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e
with:
toolchain: ${{ env.RUST_VERSION }}
- uses: Swatinem/[email protected]
- name: Run benchmark
working-directory: compiler/vm/
run: cargo bench -- --output-format bencher | tee benchmark_output.txt
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Compiler
tool: cargo
output-file-path: compiler/vm/benchmark_output.txt
gh-pages-branch: gh-pages
gh-repository: github.com/candy-lang/benchmark-results
benchmark-data-dir-path: ./
# Only push results to the benchmark repository if we ran on a commit
# to the main branch.
auto-push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
github-token: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && secrets.BENCHMARK_RESULTS_TOKEN || secrets.BENCHMARK_RESULTS_COMMENT_TOKEN }}
# Forks don't have access to secrets, so we can't create a commit
# comment. This step can still fail to notify us and the output shows
# results.
comment-always: ${{ github.secret_source == 'Actions' || github.secret_source == 'Dependabot' }}
comment-on-alert: ${{ github.secret_source == 'Actions' || github.secret_source == 'Dependabot' }}
alert-threshold: 200%
# Benchmarks running on GitHub Actions have a very high variance.
fail-on-alert: true
vscode-extension-check:
name: Check VS Code Extension
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
defaults:
run:
working-directory: vscode_extension/
steps:
- uses: actions/checkout@v3
- run: npm install
- run: npm install @microsoft/[email protected]
- name: Run ESLint
run: |
npx eslint . \
--ext .ts \
--format @microsoft/eslint-formatter-sarif \
--output-file eslint-results.sarif
continue-on-error: true
- uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: vscode_extension/eslint-results.sarif
wait-for-processing: true