Skip to content

Commit

Permalink
Merge pull request #12 from vst/8-add-github-action-to-test-on-prs
Browse files Browse the repository at this point in the history
test: add GitHub action to check, test and build codebase
  • Loading branch information
vst authored Jun 11, 2024
2 parents 739096d + 8dfa7af commit 8ac95fc
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Check, Test and Build Codebase"

on:
pull_request:
workflow_dispatch:

jobs:
check:
runs-on: "ubuntu-latest"

steps:
- name: "Checkout Codebase"
uses: "actions/checkout@v4"

- name: "Install nix"
uses: "cachix/install-nix-action@v27"
with:
nix_path: "nixpkgs=channel:nixos-24.05"

- name: "Use Magic Nix cache"
uses: "DeterminateSystems/magic-nix-cache-action@v7"

- name: "Check, Test and Build"
run: |
nix-shell --pure --run "dev-test-build"
16 changes: 15 additions & 1 deletion nix/dev-test-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@
## Fail on any error:
set -e

## Declare default styles:
_sty_bold=""
_sty_underline=""
_sty_standout=""
_sty_normal=""
_sty_black=""
_sty_red=""
_sty_green=""
_sty_yellow=""
_sty_blue=""
_sty_magenta=""
_sty_cyan=""
_sty_white=""

## Set styles if we are on terminal:
if test -t 1; then
## Check if the terminal supports colors:
Expand Down Expand Up @@ -133,4 +147,4 @@ _cabal_run
_cabal_test
_weeder
_cabal_haddock
printf "Finished all in %ss" "$(_get_diff "${_scr_start}" "$(_get_now)")"
printf "Finished all in %ss\n" "$(_get_diff "${_scr_start}" "$(_get_now)")"

0 comments on commit 8ac95fc

Please sign in to comment.