Skip to content

Commit

Permalink
tooling changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rfaulhaber committed Oct 17, 2024
1 parent d6197fe commit 56f400e
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 13 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
pull_request:
types: [opened, reopened]

defaults:
run:
shell: nu {0}


jobs:
ci:
Expand All @@ -24,23 +28,19 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- uses: hustcer/setup-nu@main
with:
version: "*"
- uses: extractions/setup-just@v2
- uses: jcs090218/setup-emacs@master
with:
version: ${{ matrix.emacs-version }}

- uses: emacs-eask/setup-eask@master
with:
version: 'snapshot'
- name: Compile module
run: |
cargo build
echo "Moving module"
mv ./target/debug/libreel.* .
eask install
just build
- name: Run tests
run: |
docker run -d --rm --name reel-test -p 8080:80 kennethreitz/httpbin
sleep 5s
eask test buttercup
docker stop reel-test
just test
6 changes: 3 additions & 3 deletions flake.lock

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

2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
emacs
nodePackages_latest.nodejs
nodePackages_latest.eask

just
];
in
forAllSystems
Expand Down
41 changes: 41 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
set shell := ['nu', '-c']

build env="dev":
cargo build {{ if env == "release" { "--release" } else { "" } }}
cp ./target/{{ if env == "release" { "release" } else { "debug" } }}/libreel.so .
eask install

test: (build "dev")
just test-setup
-eask test buttercup
just test-teardown

dist: (build "release")
eask package

clean:
cargo clean
rm libreel.*

[private]
test-setup:
#!/usr/bin/env nu
print "preparing test environment"
^docker run -d --rm --name reel-test -p 8080:80 kennethreitz/httpbin

mut state = (^docker inspect reel-test | from json | first | get State.status)

print $"state: ($state)"

while $state != "running" {
print "waiting..."
$state = (^docker inspect reel-test | from json | first | get State.status)
}

sleep 1sec

[private]
test-teardown:
#!/usr/bin/env nu
print "tearing down"
^docker stop reel-test

0 comments on commit 56f400e

Please sign in to comment.