Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ENV LUA_VER="5.4.8"
ENV LUA_CHECKSUM="4f18ddae154e793e46eeab727c59ef1c0c0c2b744e7b94219710d76f530629ae"
ENV LUAROCKS_VER="3.12.0"
ENV LUAROCKS_GPG_KEY="3FD8F43C2BB3C478"

Check warning on line 6 in Dockerfile

View workflow job for this annotation

GitHub Actions / Tests

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "LUAROCKS_GPG_KEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

RUN apt-get update && \
apt-get install -y curl gcc make unzip gnupg git && \
Expand Down Expand Up @@ -35,11 +35,14 @@
RUN luarocks install busted
RUN luarocks install alt-getopt
RUN luarocks install moonscript
RUN luarocks install date
RUN luarocks install lua-tz
RUN luarocks install luatz

FROM ubuntu:24.04

RUN apt-get update && \
apt-get install -y jq && \
apt-get install -y jq tzdata && \
rm -rf /var/lib/apt/lists/* && \
apt-get purge --auto-remove && \
apt-get clean
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

The Docker image to automatically run tests on [MoonScript](https://github.com/exercism/moonscript) solutions submitted to [Exercism].

## Added LuaRocks

For student solutions, these additional luarocks have been added to the test-runner image:

* [lua-tz](https://luarocks.org/modules/anaef/lua-tz)
* [date](https://luarocks.org/modules/tieske/date)
* [luatz](https://luarocks.org/modules/daurnimator/luatz)

## Run the test runner

To run the tests of a single solution, do the following:
Expand Down
5 changes: 5 additions & 0 deletions tests/can-use-lua-tz/.busted
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
return {
default = {
ROOT = { '.' }
}
}
8 changes: 8 additions & 0 deletions tests/can-use-lua-tz/can_use_lua_tz.moon
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tz = require 'tz'

utc_time = ->
timespec = year: 2014, month: 11, day: 1, hour: 20
zone = 'UTC'
tz.time timespec, zone

utc_time
5 changes: 5 additions & 0 deletions tests/can-use-lua-tz/can_use_lua_tz_spec.moon
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
utc_time = require 'can_use_lua_tz'

describe 'one test', ->
it 'test time in UTC', ->
assert.are.equal 1414872000, utc_time!
1 change: 1 addition & 0 deletions tests/can-use-lua-tz/expected_results.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"tests":[{"status":"pass","name":"test time in UTC","test_code":" assert.are.equal 1414872000, utc_time!"}],"status":"pass","version":2}
Loading