-
Notifications
You must be signed in to change notification settings - Fork 13
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 #36 from konst-aa/add-test-workflow
Add Dockerfile and GH actions testing workflow
- Loading branch information
Showing
4 changed files
with
81 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,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 .) |
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,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" ] |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
# akku install | ||
# bash .akku/env | ||
compile-chez-program run.ss | ||
|
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 |
---|---|---|
@@ -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 |