File tree Expand file tree Collapse file tree 5 files changed +83
-25
lines changed
Expand file tree Collapse file tree 5 files changed +83
-25
lines changed Original file line number Diff line number Diff line change 1+ # Docker build context pruning
2+ .git
3+ .github
4+ .idea
5+ .coverage
6+ .red-ecosystem-errors
7+ * .iml
8+ * .swp
9+ * .swo
10+ node_modules
11+ coverage
12+ .gitpod *
13+ # Keep examples and t; they’re needed for tests
Original file line number Diff line number Diff line change 1+ name : docker-test
2+ on :
3+ push :
4+ branches :
5+ - master
6+ - " *"
7+ pull_request :
8+
9+ jobs :
10+ build-and-test-sqlite :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v3
14+ - name : Build base image
15+ run : docker build -t red-test:base -f Dockerfile .
16+ - name : Run tests (SQLite)
17+ run : |
18+ docker run --rm --entrypoint "" red-test:base sh -lc "raku -V && zef install --/test . && prove6 -lj8 t"
19+
20+ build-and-test-postgres :
21+ runs-on : ubuntu-latest
22+ services :
23+ postgres :
24+ image : postgres:16
25+ env :
26+ POSTGRES_PASSWORD : postgres
27+ POSTGRES_USER : postgres
28+ POSTGRES_DB : red_test
29+ ports : ["5432:5432"]
30+ options : >-
31+ --health-cmd "pg_isready -U postgres" --health-interval 10s --health-timeout 5s --health-retries 5
32+ steps :
33+ - uses : actions/checkout@v3
34+ - name : Build base image
35+ run : docker build -t red-test:pg -f Dockerfile .
36+ - name : Wait for Postgres
37+ run : |
38+ for i in {1..10}; do
39+ docker run --rm --network host postgres:16 pg_isready -h 127.0.0.1 -U postgres && exit 0 || sleep 3;
40+ done
41+ exit 1
42+ - name : Run tests (PostgreSQL)
43+ env :
44+ RED_DATABASE : " Pg host=127.0.0.1 port=5432 dbname=red_test user=postgres password=postgres"
45+ run : |
46+ docker run --rm --network host --entrypoint "" -e RED_DATABASE="$RED_DATABASE" red-test:pg sh -lc "zef install --/test . && prove6 -l t"
Original file line number Diff line number Diff line change 1- FROM rakudo-star:alpine
2- WORKDIR /code
3- COPY META6.json .
4- RUN apk add git gcc libc-dev libuuid sqlite-libs libpq
5- # RUN zef install "NativeLibs:ver<0.0.7>:auth<github:salortiz>" --force-test
6- RUN zef install Config Config::Parser::json
7- RUN zef install --deps-only .
8- ENTRYPOINT zef install -v .
9- VOLUME /code
1+ FROM rakudo-star:alpine
2+ WORKDIR /code
3+ COPY . .
4+ ENV PATH="/usr/share/raku/site/bin:/usr/local/share/raku/site/bin:/usr/share/perl6/site/bin:/usr/local/share/perl6/site/bin:${PATH}"
5+ RUN apk add --no-cache git gcc libc-dev libuuid sqlite-libs postgresql-dev postgresql-libs openssl-dev make bash
6+ RUN zef install --/test Config Config::Parser::json App::Prove6
7+ RUN zef install --/test --test-depends --deps-only .
8+ ENTRYPOINT ["zef" ,"install" ,"-v" ,"." ]
Original file line number Diff line number Diff line change 1- FROM registry.gitlab.com/tyil/docker-perl6 :alpine-latest
2- WORKDIR /code
3- COPY META6.json .
4- RUN apk add git gcc libc-dev libuuid sqlite-libs
5- RUN zef install "NativeLibs:ver<0.0.7>:auth<github:salortiz>" --force-test
6- RUN zef install --deps-only .
7- ENTRYPOINT zef install -v .
8- VOLUME /code
1+ FROM rakudo-star :alpine
2+ WORKDIR /code
3+ COPY . .
4+ ENV PATH="/usr/share/raku/site/bin:/usr/local/share/raku/site/bin:/usr/share/perl6/site/bin:/usr/local/share/perl6/site/bin:${PATH}"
5+ RUN apk add --no-cache git gcc libc-dev libuuid sqlite-libs openssl-dev make bash
6+ RUN zef install --/test App::Prove6 Pod::To::Markdown
7+ RUN zef install --/test --test-depends --deps-only .
8+ ENTRYPOINT ["zef","install","-v","."]
Original file line number Diff line number Diff line change 1- FROM rakudo-star:alpine
2- WORKDIR /code
3- COPY META6.json .
4- RUN apk add git gcc libc-dev libuuid sqlite-libs libc6-compat libressl-dev make bash libpq libsodium
5- # RUN zef install "NativeLibs:ver<0.0.7>:auth<github:salortiz>" --force-test
6- RUN zef install Config Config::Parser::json Pod::To::Markdown
7- RUN zef install --/test cro App::RaCoCo
8- RUN zef install --deps-only .
1+ FROM rakudo-star:alpine
2+ WORKDIR /code
3+ COPY . .
4+ ENV PATH="/usr/share/raku/site/bin:/usr/local/share/raku/site/bin:/usr/share/perl6/site/bin:/usr/local/share/perl6/site/bin:${PATH}"
5+ RUN apk add --no-cache git gcc libc-dev libuuid sqlite-libs openssl-dev make bash
6+ RUN zef install --/test Config Config::Parser::json Pod::To::Markdown App::Prove6
7+ RUN zef install --/test cro App::RaCoCo
8+ RUN zef install --/test --test-depends --deps-only .
You can’t perform that action at this time.
0 commit comments