Add rust-toolchain.toml #983
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: Compiler | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: dsherret/rust-toolchain-file@v1 | |
- 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: dsherret/rust-toolchain-file@v1 | |
# - 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: dsherret/rust-toolchain-file@v1 | |
- 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 |