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
6 changes: 6 additions & 0 deletions .busted
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@ return {
helper = "spec/test_helper.lua",
lpath = "./src/?.lua;./src/?/init.lua",
verbose = true
},
e2e = {
ROOT = {"spec"},
pattern = "e2e_test",
lpath = "./src/?.lua;./src/?/init.lua",
verbose = true
}
}
83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CI

on:
pull_request:
push:
branches: [main, develop]
workflow_dispatch:

jobs:
test:
name: Lua ${{ matrix.lua-version }}
runs-on: ubuntu-latest

services:
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5

strategy:
fail-fast: false
matrix:
lua-version:
- "5.3"
- "5.4"

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Lua ${{ matrix.lua-version }}
uses: leafo/gh-actions-lua@v10
with:
luaVersion: ${{ matrix.lua-version }}

- name: Install LuaRocks
uses: leafo/gh-actions-luarocks@v4

- name: Install system libraries
run: |
sudo apt-get update
sudo apt-get install -y libsqlite3-dev libssl-dev

- name: Install dependencies
run: |
luarocks install dkjson
luarocks install luasec
luarocks install luasocket
luarocks install multipart-post
luarocks install luautf8
luarocks install copas
luarocks install lsqlite3
luarocks install busted

- name: Run tests
run: busted --no-coverage -o utfTerminal

lint:
name: Lint
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Lua
uses: leafo/gh-actions-lua@v10
with:
luaVersion: "5.3"

- name: Install LuaRocks
uses: leafo/gh-actions-luarocks@v4

- name: Install luacheck
run: luarocks install luacheck

- name: Run luacheck
run: luacheck src/ --no-unused-args --no-max-line-length --globals _G _TEST
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
*.env
4 changes: 2 additions & 2 deletions spec/builders_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ describe('builders', function()
assert.equals('HTML', c.parse_mode)
end)

it('converts boolean true to markdown', function()
it('converts boolean true to MarkdownV2', function()
local c = api.input_text_message_content('Hello', true)
assert.equals('markdown', c.parse_mode)
assert.equals('MarkdownV2', c.parse_mode)
end)
end)

Expand Down
Loading
Loading