Skip to content

Commit

Permalink
Merge pull request #2 from dominikwilkowski/rust
Browse files Browse the repository at this point in the history
New rust engine
  • Loading branch information
dominikwilkowski authored May 2, 2024
2 parents 0c89f26 + d14a0d9 commit 4517117
Show file tree
Hide file tree
Showing 25 changed files with 5,416 additions and 2,833 deletions.
163 changes: 136 additions & 27 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,145 @@
name: Testing
name: Linting & Testing

on: [push]
defaults:
run:
shell: bash

on:
push:
branches:
- 'main'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- 'main'

jobs:
testing:
runs-on: ubuntu-latest
debug:
name: Debugging action on ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
runs-on: ${{ matrix.os }}

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Installing tree
run: sudo apt-get -y install tree & which tree

- name: Listing all files
run: tree -I "target*|.git*"


fmt:
name: Running cargo fmt on ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
runs-on: ${{ matrix.os }}
env:
CARGO_TERM_COLOR: always

steps:
- uses: actions/checkout@v2
- name: Checkout repo
uses: actions/checkout@v4

- name: Update toolchain & add rustfmt
run: |
rustup update
rustup component add rustfmt
- name: Run rustfmt
run: cargo fmt --all --check


check:
name: Running cargo check on ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
runs-on: ${{ matrix.os }}
env:
CARGO_TERM_COLOR: always

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Update toolchain
run: rustup update

- name: Setup Node
uses: actions/[email protected]
- name: Run check
run: cargo check


clippy:
name: Running cargo clippy on ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-Dwarnings"

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Update toolchain & add clippy
run: |
rustup update
rustup component add clippy
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
node-version: '12.x'
prefix-key: clippy-v0
key: clippy-${{ matrix.os }}

- name: Fetch dependencies
run: cargo fetch --locked

- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Run clippy
run: cargo clippy -- --deny warnings

- name: Cache dependencies
uses: actions/cache@v2

test:
name: Running cargo test on ${{ matrix.os }}
needs: [fmt, check, clippy]
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
env:
CARGO_TERM_COLOR: always

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Update toolchain
run: rustup update

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Node version
run: node --version
- name: npm version
run: npm --version
- name: Yarn version
run: yarn --version

- run: yarn install --frozen-lockfile
- run: yarn test
prefix-key: test-v0
key: test-${{ matrix.os }}

- name: Build
run: cargo build

- name: Run tests
run: cargo test
33 changes: 16 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
.DS_Store
### Rust template
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# system files
.idea/
*.sublime-project
*.sublime-workspace
codekit-config.json
*.codekit
node_modules
.sass-cache
.idea
validation-report.json
validation-status.json
npm-debug.log
lerna-debug.log
package-lock.json
.DS_Store

# These are backup files generated by rustfmt
**/*.rs.bk

dist/*
coverage/*
__tests__/*
*.log
# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

yarn.lock
package-lock.json
# Ignore the main file as it's used for testing
src/main.rs
7 changes: 0 additions & 7 deletions .prettierrc

This file was deleted.

Loading

0 comments on commit 4517117

Please sign in to comment.