Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: CI/CD #98

Merged
merged 19 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
language: en-US
tone_instructions: >-
You must use a respectful, but commanding tone, as if you were impersonating an AI deity.
early_access: true
enable_free_tier: true
reviews:
profile: assertive
request_changes_workflow: true
high_level_summary: true
high_level_summary_placeholder: '@coderabbitai summary'
auto_title_placeholder: '@coderabbitai'
review_status: true
poem: true
collapse_walkthrough: false
sequence_diagrams: true
path_filters: []
path_instructions:
- path: ".hlint.yaml"
instructions: |
Ignore this file
- path: "*.hs"
instructions: |
Remember that this is a NeoHaskell file. NeoHaskell is a
Haskell dialect that is inspired by Elm, therefore the
Elm style and conventions should be followed. Also,
Elm core libs are available, and the Haskell Prelude is
ignored, as the NoImplicitPrelude extension is enabled.
abort_on_close: true
auto_review:
enabled: true
auto_incremental_review: true
ignore_title_keywords: []
labels: []
drafts: false
base_branches: []
tools:
shellcheck:
enabled: true
ruff:
enabled: false
markdownlint:
enabled: true
github-checks:
enabled: true
timeout_ms: 90000
languagetool:
enabled: true
enabled_only: false
level: default
enabled_rules: []
disabled_rules:
- EN_UNPAIRED_BRACKETS
enabled_categories: []
disabled_categories:
- TYPOS
- TYPOGRAPHY
- CASING
biome:
enabled: true
hadolint:
enabled: true
swiftlint:
enabled: true
phpstan:
enabled: true
level: default
golangci-lint:
enabled: true
yamllint:
enabled: true
gitleaks:
enabled: true
checkov:
enabled: true
detekt:
enabled: true
eslint:
enabled: true
ast-grep:
packages: []
rule_dirs: []
util_dirs: []
essential_rules: true
chat:
auto_reply: true
knowledge_base:
opt_out: false
learnings:
scope: global
issues:
scope: global
jira:
project_keys: []
linear:
team_keys: []
51 changes: 51 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "Test"

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
tests:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- uses: cachix/cachix-action@v14
with:
name: devenv

- name: Install devenv.sh
run: nix profile install nixpkgs#devenv

- name: Cache Cabal
uses: actions/cache@v3
with:
path: |
~/.cabal
./dist-newstyle
key: ${{ runner.os }}-${{ hashFiles('**/*.lock') }}



- name: Update Cabal Hackage list
run: devenv shell run-update

# - name: Build the devenv shell and run any pre-commit hooks
# run: devenv test
NickSeagull marked this conversation as resolved.
Show resolved Hide resolved

- name: Build the project
run: devenv shell run-build

- name: Run core tests
run: devenv shell run-core-tests

- name: Run CLI tests
run: devenv shell run-cli-tests
4 changes: 3 additions & 1 deletion cli/test/Main.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module Main (main) where

import Core
NickSeagull marked this conversation as resolved.
Show resolved Hide resolved

main :: IO ()
main = putStrLn "Test suite not yet implemented."
main = print "Test suite not yet implemented."
4 changes: 3 additions & 1 deletion core/test/Main.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module Main (main) where

import Core
NickSeagull marked this conversation as resolved.
Show resolved Hide resolved

main :: IO ()
main = putStrLn "Test suite not yet implemented."
main = print "Test suite not yet implemented."
12 changes: 6 additions & 6 deletions devenv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1720853497,
"lastModified": 1722019186,
"owner": "cachix",
"repo": "devenv",
"rev": "7f569a0f2473b9f6000fd9e4c32511fd1b0d37c1",
"treeHash": "4d452ecc8223834e39d507f9ea92308f007ee05d",
"rev": "075c114280751f956335333179304d14ae01aedc",
"treeHash": "0e550d934a0d3f6248accff4c019c013e8e237e6",
"type": "github"
},
"original": {
Expand Down Expand Up @@ -88,11 +88,11 @@
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1720954236,
"lastModified": 1722087241,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "53e81e790209e41f0c1efa9ff26ff2fd7ab35e27",
"treeHash": "ca1f1273cf201da604f7c704535d4b7fac62cdb2",
"rev": "8c50662509100d53229d4be607f1a3a31157fa12",
"treeHash": "cbc560aaf05dfc49bde55e55f603d7245515b13a",
"type": "github"
},
"original": {
Expand Down
15 changes: 14 additions & 1 deletion devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,23 @@
git
ghcid
haskellPackages.implicit-hie
haskellPackages.doctest
];

# https://devenv.sh/scripts/
scripts.watch.exec = "ghcid --command=cabal repl $1";
scripts = {
run-watch.exec = "ghcid --command=cabal repl $1";
run-build.exec = "cabal build all";
run-update.exec = "cabal update";
run-cli.exec = "cabal run nhcli -- $@";
run-core-tests.exec = ''
cabal repl nhcore --with-ghc=doctest && \
cabal test nhcore
'';
run-cli-tests.exec = ''
cabal test nhcli
'';
};

enterShell = ''
gen-hie > hie.yaml
Expand Down
Loading