Skip to content

Commit aa24973

Browse files
committed
Use GitHub Actions in agent template
1 parent 71f4c18 commit aa24973

3 files changed

Lines changed: 82 additions & 15 deletions

File tree

lib/huginn_agent/cli/new.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ def run
4242
templates = {
4343
"Gemfile.tt" => "Gemfile",
4444
"gitignore.tt" => ".gitignore",
45+
"github/workflows/ci.yml.tt" => ".github/workflows/ci.yml",
4546
"lib/new_agent.rb.tt" => "lib/#{namespaced_path}.rb",
4647
"lib/new_agent/new_agent.rb.tt" => "lib/#{namespaced_path}/#{agent_file_name}.rb",
4748
"spec/new_agent_spec.rb.tt" => "spec/#{agent_file_name}_spec.rb",
4849
"newagent.gemspec.tt" => "#{gem_name}.gemspec",
4950
"Rakefile.tt" => "Rakefile",
50-
"README.md.tt" => "README.md",
51-
"travis.yml.tt" => ".travis.yml"
51+
"README.md.tt" => "README.md"
5252
}
5353

5454
if thor.yes?(MIT_QUESTION)
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
test-postgresql:
10+
runs-on: ubuntu-latest
11+
12+
services:
13+
postgres:
14+
image: postgres:17
15+
env:
16+
POSTGRES_USER: huginn
17+
POSTGRES_PASSWORD: huginn
18+
POSTGRES_DB: huginn_test
19+
ports:
20+
- 5432:5432
21+
options: >-
22+
--health-cmd="pg_isready"
23+
--health-interval=10s
24+
--health-timeout=5s
25+
--health-retries=5
26+
27+
env:
28+
DATABASE_ADAPTER: postgresql
29+
DATABASE_HOST: 127.0.0.1
30+
DATABASE_USERNAME: huginn
31+
DATABASE_PASSWORD: huginn
32+
DATABASE_NAME: huginn_test
33+
APP_SECRET_TOKEN: 0b4a2a529a3bb09cc39561e117c13d6e04288e144c322b8d577b0e4589435dce8f512a0e0d7e17c54802a5575c92e1e68550cd18
34+
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- uses: ruby/setup-ruby@v1
39+
with:
40+
ruby-version: "3.4"
41+
bundler-cache: true
42+
43+
- name: Run tests
44+
run: bundle exec rake
45+
46+
test-mysql:
47+
runs-on: ubuntu-latest
48+
49+
services:
50+
mysql:
51+
image: mysql:8.0
52+
env:
53+
MYSQL_ROOT_PASSWORD: huginn
54+
MYSQL_DATABASE: huginn_test
55+
ports:
56+
- 3306:3306
57+
options: >-
58+
--health-cmd="mysqladmin ping -h 127.0.0.1"
59+
--health-interval=10s
60+
--health-timeout=5s
61+
--health-retries=5
62+
63+
env:
64+
DATABASE_ADAPTER: mysql2
65+
DATABASE_HOST: 127.0.0.1
66+
DATABASE_USERNAME: root
67+
DATABASE_PASSWORD: huginn
68+
DATABASE_NAME: huginn_test
69+
APP_SECRET_TOKEN: 0b4a2a529a3bb09cc39561e117c13d6e04288e144c322b8d577b0e4589435dce8f512a0e0d7e17c54802a5575c92e1e68550cd18
70+
71+
steps:
72+
- uses: actions/checkout@v4
73+
74+
- uses: ruby/setup-ruby@v1
75+
with:
76+
ruby-version: "3.4"
77+
bundler-cache: true
78+
79+
- name: Run tests
80+
run: bundle exec rake

lib/huginn_agent/templates/newagent/travis.yml.tt

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)