Skip to content

Commit

Permalink
Merge pull request #1 from janbridley/arrcomp
Browse files Browse the repository at this point in the history
Array Comprehensions
  • Loading branch information
janbridley authored Jan 26, 2025
2 parents 86a438b + 3940237 commit 4106034
Show file tree
Hide file tree
Showing 10 changed files with 1,115 additions and 1 deletion.
77 changes: 77 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: test

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
push:
branches: [main]

workflow_dispatch:

defaults:
run:
shell: bash

env:
CARGO_TERM_COLOR: always
CLICOLOR: 1

jobs:
unit_test:
name: Unit test [${{ matrix.mode }}-rust-${{ matrix.rust }}-${{ matrix.os }}]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-24.04
- macos-14
rust:
- 1.81.0
mode:
- debug

include:
- os: ubuntu-24.04
rust: 1.81.0
mode: release

steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Update rust
run: rustup install ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}

- name: Check rust installation
run: rustc -vV
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-rust-${{ matrix.rust }}-cargo-unit-test-${{ matrix.mode }}-${{ hashFiles('**/Cargo.lock') }}

- name: Build
run: cargo build ${{ matrix.mode == 'release' && '--release' || '' }} --verbose
- name: Run tests
run: cargo test ${{ matrix.mode == 'release' && '--release' || '' }} --verbose
- name: Build API documentation
run: cargo doc --no-deps


tests_complete:
name: All tests
if: always()
# needs: [unit_test, execute_tutorials, build_documentation]
needs: [unit_test]
runs-on: ubuntu-latest

steps:
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
- name: Done
run: exit 0
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
39 changes: 39 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
ci:
autoupdate_schedule: quarterly
autoupdate_branch: 'trunk'
autofix_prs: true

default_language_version:
rust: 1.81.0

repos:
- repo: https://github.com/backplane/pre-commit-rust-hooks
rev: v1.1.0
hooks:
- id: fmt
- id: check
- id: clippy
args:
- --all-targets
- --all-features
- --
- -Dwarnings
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-json
- id: check-toml
- id: check-yaml
- id: check-case-conflict
- id: mixed-line-ending
- repo: https://github.com/codespell-project/codespell
rev: v2.4.0
hooks:
- id: codespell
args: ["--ignore-words-list=crate"]
- repo: https://github.com/rhysd/actionlint
rev: v1.7.7
hooks:
- id: actionlint
279 changes: 279 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4106034

Please sign in to comment.