Skip to content

Commit

Permalink
Merge pull request #36 from konst-aa/add-test-workflow
Browse files Browse the repository at this point in the history
Add Dockerfile and GH actions testing workflow
  • Loading branch information
ufo5260987423 authored Feb 8, 2024
2 parents 4b4993a + 19b8f3a commit 1238651
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Test

on:
pull_request:
branches: main

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build and test
run: docker run $(docker build -q .)
46 changes: 46 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FROM alpine:latest as build-chez

RUN apk update && apk --no-cache --update add \
gcc git make musl-dev curl \
ncurses ncurses-dev util-linux-dev

WORKDIR /root/
RUN curl -L https://github.com/cisco/ChezScheme/releases/download/v9.6.4/csv9.6.4.tar.gz | tar -zx
RUN mv csv9.6.4 ChezScheme

WORKDIR /root/ChezScheme
RUN ./configure --threads --disable-x11
RUN make && make install



FROM akkuscm/akku
RUN apk update && apk --no-cache --update add bash

# Ensure that there are no collisions
RUN rm -rf /usr/lib/csv9.6.4/

COPY --from=build-chez /usr/bin/scheme /usr/bin/
COPY --from=build-chez /usr/lib/csv9.6.4/ /usr/lib/csv9.6.4/

RUN mkdir /root/scheme-langserver/
WORKDIR /root/scheme-langserver/

COPY Akku.lock Akku.manifest /root/scheme-langserver/

# Install deps (most important operation to cache)
RUN akku install

COPY util /root/scheme-langserver/util/
COPY protocol /root/scheme-langserver/protocol/
COPY virtual-file-system /root/scheme-langserver/virtual-file-system/
COPY analysis /root/scheme-langserver/analysis/
COPY tests /root/scheme-langserver/tests/

COPY scheme-langserver.sls output-type-analysis.ss test.sh run.ss /root/scheme-langserver/

# Install project
RUN akku install


ENTRYPOINT [ "./test.sh" ]
2 changes: 2 additions & 0 deletions build.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

# akku install
# bash .akku/env
compile-chez-program run.ss
Expand Down
20 changes: 19 additions & 1 deletion test.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
find ./tests ! -path "./tests/output-identifier-types.sps" ! -path "./tests/parallel-log-debug.sps" ! -path "./tests/log-debug.sps" -name "*sps" -exec scheme --script {} \;
#!/usr/bin/env bash
source .akku/bin/activate

skip=(
"./tests/output-identifier-types.sps"
"./tests/parallel-log-debug.sps"
"./tests/log-debug.sps"
)

success=0

for test in $(find ./tests | grep ".sps$")
do
if [[ "${skip[@]}" =~ $test ]]; then continue; fi
scheme --quiet $test
success=$(($? || $success))
done;

exit $success

0 comments on commit 1238651

Please sign in to comment.