-
Notifications
You must be signed in to change notification settings - Fork 1
106 lines (87 loc) · 2.57 KB
/
docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Docker
on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:
concurrency:
group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}'
cancel-in-progress: true
jobs:
test-sinatra:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
container:
- 'ubuntu-20.04'
- 'alpine-3.17'
package_ruby_ver:
- '3.2.6'
- '3.3.6'
container:
image: ghcr.io/tamatebako/tebako-${{ matrix.container }}:latest
steps:
- name: Install curl/procps
run: |
if [ -e "/etc/lsb-release" ]; then
apt-get -y update
apt-get -y install curl procps
elif [ -e "/etc/alpine-release" ]; then
apk --no-cache --upgrade add curl procps
fi
- name: Checkout sample
uses: actions/checkout@v4
- name: Package
run: tebako press -e app.rb -o sinatra.tebako -r sinatra -R ${{ matrix.package_ruby_ver }}
- name: Smoke check
run: ./sinatra.tebako -h
- name: Start packaged Sinatra application
run: ./sinatra.tebako &
env:
PORT: 4567
- name: Wait for Sinatra to start
run: sleep 10
- name: Place GET request
run: |
curl http://localhost:4567
- name: End Sinatra application
run: pkill -f sinatra.tebako
test-rails:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
container:
- 'ubuntu-20.04'
- 'alpine-3.17'
package_ruby_ver:
- '3.2.6'
container:
image: ghcr.io/tamatebako/tebako-${{ matrix.container }}:latest
steps:
- name: Install curl/procps
run: |
if [ -e "/etc/lsb-release" ]; then
apt-get -y update
apt-get -y install curl procps
elif [ -e "/etc/alpine-release" ]; then
apk --no-cache --upgrade add curl procps
fi
- name: Checkout sample
uses: actions/checkout@v4
- name: Package
run: tebako press -e bin/rails -o rails.tebako -r ror -R ${{ matrix.package_ruby_ver }}
- name: Create data folder
run: mkdir -p ror-data
- name: Test
run: ./rails.tebako server --help
- name: Start packaged Rails application
run: ./rails.tebako server --port=4567 --tebako-mount local/tmp:$PWD/ror-data/tmp --tebako-mount local/log:$PWD/ror-data/log &
- name: Wait for Rails to start
run: sleep 10
- name: Place GET request
run: |
curl http://localhost:4567
- name: End Rails application
run: pkill -f rails.tebako