Skip to content

Commit

Permalink
Merge branch 'master' of github.com:kindelia/hvm
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorTaelin committed Jun 6, 2022
2 parents 67bc0a5 + 9bd4599 commit caca9b0
Show file tree
Hide file tree
Showing 24 changed files with 2,853 additions and 132 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/cargo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Cargo
on:
workflow_call:
jobs:
cargo_check:
name: 👁️‍🗨️ Cargo Check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: check

cargo_test:
name: 🧪 Cargo Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: test

cargo_fmt:
name: 💅 Cargo Fmt
continue-on-error: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

cargo_clippy:
name: 👃 Cargo Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
109 changes: 10 additions & 99 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,104 +1,15 @@
name: CI
on:
push:
pull_request:
types: [opened, review_requested, ready_for_review]

name: Continuous Integration

jobs:
cargo_check:
if: github.event.pull_request.draft == false
name: cargo check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: check

cargo_test:
if: github.event.pull_request.draft == false
name: cargo test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: test

cargo_fmt:
if: github.event.pull_request.draft == false
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

cargo_clippy:
if: github.event.pull_request.draft == false
name: cargo clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

nix_build:
if: github.event.pull_request.draft == false
name: nix build
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: cachix/install-nix-action@v15
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- run: nix build

nix_flake_check:
if: github.event.pull_request.draft == false
name: nix flake check
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: cachix/install-nix-action@v15
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- run: nix build -f . checks.x86_64-linux
cargo:
if: github.event.pull_request.draft == false
uses: ./.github/workflows/cargo.yml
tests:
needs: [cargo]
uses: ./.github/workflows/tests.yml
nix:
needs: [cargo]
uses: ./.github/workflows/nix.yml
25 changes: 25 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Nix
on:
workflow_call:
jobs:
nix_build:
name: 🔨 Nix Build
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: cachix/install-nix-action@v15
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- run: nix build

nix_flake_check:
name: ❄️ Nix Flake Check
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: cachix/install-nix-action@v15
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- run: nix build -f . checks.x86_64-linux
35 changes: 35 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Tests
on:
workflow_call:
jobs:
hvm-tests:
name: 🔎 HVM Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
run_mode: [interpreted, compiled, single-thread]
exclude:
- os: windows-latest
run_mode: compiled
- os: windows-latest
run_mode: single-thread
env:
# Add .exe suffix to HVM command on Windows
HVM_CMD: ${{matrix.os != 'windows-latest' && './target/release/hvm' || './target/release/hvm.exe'}}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v3
with:
python-version: "3.10"
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- run: cargo build --release
# FIXME: compiled mode of kind 2 teste don't work because compiled
# code don't have sugar for strings
- run: python3 -X utf8 tests/test_cli.py --hvm-cmd ${{env.HVM_CMD}}
--run-mode ${{ matrix.run_mode }} --skip-test kind2
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
*.o
*.tmp
*.out

tests/**/*.c
~*
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
"itertools",
"lambolt",
"oper",
"pthread",
"readback",
"redex",
"rulebook"
],
"cSpell.ignoreWords": ["argm", "arit", "ctrs", "dups"],
"rust-analyzer.checkOnSave.command": "clippy"
"rust-analyzer.checkOnSave.command": "clippy",
"python.analysis.typeCheckingMode": "strict",
}
20 changes: 10 additions & 10 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 caca9b0

Please sign in to comment.