-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from sifive/wake-extras-ci
Add Basic CI checks
- Loading branch information
Showing
6 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: "Run Tests" | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-22.04 | ||
name: Run Tests | ||
steps: | ||
- name: Clone wake-extras | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Download wake | ||
run: wget https://github.com/sifive/wake/releases/download/v39.1.0/ubuntu-22-04-wake_39.1.0-1_amd64.deb | ||
|
||
- name: Install wake | ||
run: sudo apt-get install ./ubuntu-22-04-wake_39.1.0-1_amd64.deb | ||
|
||
- name: Initialize wake | ||
run: wake --init . | ||
|
||
- name: Typecheck wake | ||
run: wake -x 'Unit' | ||
|
||
- name: Check formatting | ||
run: wake-format --dry-run --auto | ||
|
||
- name: Run tests | ||
run: ./tests/test.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/**/wake.db* | ||
/**/wake.log |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package result | ||
|
||
# When `result` is Fail, prefixes the internal error message with `prefix` | ||
# | ||
# Parameters: | ||
# - `prefix`: The message to prepend to `result` | ||
# - `result`: The Result which may be prepended to | ||
# | ||
# Examples: | ||
# ``` | ||
# prefixError "foo" (Pass 123) -> Pass 123 | ||
# prefixError "foo" (Fail (Error "bar" stack)) => Fail (Error "foobar" stack) | ||
# ``` | ||
export def prefixError (prefix: String): (result: Result a Error) => Result a Error = match _ | ||
Pass r -> Pass r | ||
Fail (Error msg stack) -> Fail (Error "{prefix}{msg}" stack) | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package tests | ||
|
||
from wake import _ | ||
from query import _ | ||
|
||
export def runQueryTests _ = | ||
require 4, Nil = single 4 | ||
else failWithError "Unexpected value for single" | ||
|
||
Pass Unit |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#! /bin/bash | ||
|
||
set -ex | ||
|
||
wake --in tests runQueryTests |