Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
Signed-off-by: Filippo Costa <filippo@neysofu.me>
  • Loading branch information
neysofu committed Jun 21, 2024
1 parent 1dfbd7f commit dcf7782
Show file tree
Hide file tree
Showing 50 changed files with 1,430 additions and 31 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
# This is faster for CI: https://github.com/dtolnay/rust-toolchain/issues/26.
CARGO_INCREMENTAL: "0"

jobs:
check:
name: check
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: rui314/setup-mold@v1
- name: Install Rust
run: rustup show && rustup install nightly && rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu # Nightly is needed for our configuration of cargo fmt
- run: cargo check --all-targets --all-features
- run: cargo test --all-targets --all-features
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
target/
a.out

# Rust and Cargo
**/*.rs.bk
Expand Down
251 changes: 251 additions & 0 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[workspace]
resolver = "2"
members = ["crates/*"]
31 changes: 0 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,6 @@
width="30%">
</img>
</p>
<p align="center">
<img
src="https://img.shields.io/travis/neysofu/ousia.svg"
alt="Travis CI status">
</img>
<a href="https://github.com/neysofu/ousia/blob/master/LICENSE.txt">
<img
src="https://img.shields.io/badge/license-BSD-blue.svg"
alt="BSD-3 Clause license">
</img>
</a>
<a href="https://github.com/neysofu/ousia/releases">
<img
src="https://img.shields.io/github/release/neysofu/ousia.svg"
alt="Last release">
</img>
</a>
<a href="https://gitter.im/ousialang/Lobby">
<img
src="https://badges.gitter.im/ousialang/ousia.svg"
alt="Gitter chat">
</img>
</a>
<a href="https://gitter.im/ousialang/Lobby">
<img
src="https://img.shields.io/badge/irc-%23ousia%20on%20Freenode-green.svg"
alt="IRC channel on Freenode">
</img>
</a>

</p>

# Ousia

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ fun foobar() {
bar = 3
return bar
}

type U32 = struct {
a: U8,
b: U8,
c: U8,
d: U8,
}
22 changes: 22 additions & 0 deletions examples/Color.oa
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
trait Rgb: $Unit[$Color] = {
let r: $Ratio
let g: $Ratio
let b: $Ratio

let as | $CMYK = (
$Cmyk ([R1,G1,B1] map (X -> (1-X-K)/(1-K)),K)
) where {
let (R1, G1, B1) = ($R, $G, $B) map (_/255)
let K = 1 - (($R1, $G1, $B1) max) }

as $HSL = {
let R1,G1,B1 = [R,G,B] map (_/255)
set MAX = [R,G,B] max
set MIN = [R,G,B] min
set H,S,L = (MAX+MIN) / 2
if MAX == MIN then {
H,S = 0 }
else {
let DIFF = MAX-MIN }}

let gray = ($R*0.299 + $G*0.587 + $B*0.114) as $Ratio }
Loading

0 comments on commit dcf7782

Please sign in to comment.