Skip to content

Commit

Permalink
Merge branch 'tomas-bareikis:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
adomaskizogian authored Sep 13, 2023
2 parents f17cbd6 + 89af266 commit 13ce9f3
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/test-sh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Run tests

on:
pull_request:
paths:
- 'sh/**'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"

- name: Test
run: LANGUAGE=sh go test -v ./... -count 1
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,12 @@ VOLUME /opt/cs
WORKDIR /opt
ENV LANGUAGE=cs
CMD ["/opt/challenge", "-test.v"]

FROM ubuntu:22.04 as sh
COPY --from=builder /app/challenge /opt/challenge
COPY --from=builder /app/tests /opt/tests
COPY --from=builder /app/run-sh.sh /opt/run-sh.sh
VOLUME /opt/sh
WORKDIR /opt
ENV LANGUAGE=sh
CMD ["/opt/challenge", "-test.v"]
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ docker run -v ${PWD}/cs:/opt/cs aurelijusbanelis/challenge:cs
```
Where your code is in `cs` folder with `cs/Program.cs` file.

### Shell

```shell
docker run -v ${PWD}/sh:/opt/sh aurelijusbanelis/challenge:sh
```
Where your code is in `sh` folder with `sh/main.sh` file.


### Not trusting docker?

Expand All @@ -53,6 +60,7 @@ docker build --target go . -t aurelijusbanelis/challenge:go
docker build --target php . -t aurelijusbanelis/challenge:php
docker build --target js . -t aurelijusbanelis/challenge:js
docker build --target cs . -t aurelijusbanelis/challenge:cs
docker build --target sh . -t aurelijusbanelis/challenge:sh
```

See [Dockerfile](Dockerfile) and [GitHub Actions](.github/workflows/infrastructure.yml) for details.
Expand Down
3 changes: 3 additions & 0 deletions run-sh.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

./sh/main.sh
1 change: 1 addition & 0 deletions sh/main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#!/bin/sh

0 comments on commit 13ce9f3

Please sign in to comment.