-
Notifications
You must be signed in to change notification settings - Fork 1
166 lines (160 loc) · 4.89 KB
/
main.yml
File metadata and controls
166 lines (160 loc) · 4.89 KB
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: Test
on:
push:
branches:
- main
pull_request:
jobs:
test:
strategy:
fail-fast: false
matrix:
ruby: ['3.4', '3.3', '3.2']
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
ruby: '2.7.1'
- os: ubuntu-latest
ruby: '2.4.2'
- os: windows-latest
ruby: '2.7.1'
- os: windows-latest
ruby: '2.4.2'
runs-on: ${{ matrix.os }}
name: Test with Ruby ${{ matrix.ruby }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Test
run: bundle exec rake
build:
runs-on: ubuntu-latest
name: Build gem
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
- name: Build
run: bundler exec rake build
- uses: actions/upload-artifact@v4
with:
name: gem
path: pkg/*.gem
gem-test:
needs: build
strategy:
fail-fast: false
matrix:
ruby: ['3.4', '3.3', '3.2', '2.7.1']
# macOS is excluded because of the difficulty in assuming a macOS shell behavior.
os: [ubuntu-latest, windows-latest]
include:
- os: ubuntu-latest
shell: bash
- os: windows-latest
shell: cmd
- ruby: '2.7.1'
fluentd: '1.11.1'
runs-on: ${{ matrix.os }}
name: Gem with Ruby ${{ matrix.ruby }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- uses: actions/download-artifact@v4
with:
name: gem
path: pkg
- name: Install specific version Fluentd
if: ${{ matrix.fluentd != '' }}
run: gem install fluentd --version ${{ matrix.fluentd }}
- name: Install gem
run: gem install pkg/*
- name: Test command (bash)
if: ${{ matrix.shell == 'bash' }}
run: test/script/command-test.bash
shell: bash
- name: Test command (cmd)
if: ${{ matrix.shell == 'cmd' }}
run: test/script/command-test.bat
shell: cmd
gem-test-with-package:
needs: build
strategy:
fail-fast: false
matrix:
test:
- td-agent-v3.1.1.el7-test.bash
- td-agent-v4.0.0.el8-test.bash
- fluent-package-v5.0.1.el9-test.bash
- td-agent-v3.1.1.xenial-test.bash
- td-agent-v4.0.0.focal-test.bash
- fluent-package-v5.0.1.jammy-test.bash
include:
- test: td-agent-v3.1.1.el7-test.bash
vm: centos-7
- test: td-agent-v4.0.0.el8-test.bash
vm: rockylinux-8
- test: fluent-package-v5.0.1.el9-test.bash
vm: almalinux-9
- test: td-agent-v3.1.1.xenial-test.bash
vm: ubuntu-xenial
- test: td-agent-v4.0.0.focal-test.bash
vm: ubuntu-focal
- test: fluent-package-v5.0.1.jammy-test.bash
vm: ubuntu-jammy
runs-on: ubuntu-latest
name: ${{ matrix.test }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: gem
path: pkg
- name: Set up VirtualBox
run: |
sudo apt update
sudo apt install -y virtualbox
- name: Set up Vagrant
run: |
wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install -y vagrant
vagrant --version
vagrant status
- name: Test
run: |
vagrant up ${{ matrix.vm }}
vagrant ssh ${{ matrix.vm }} -- /vagrant/test/script/${{ matrix.test }}
gem-test-with-msi-package:
needs: build
strategy:
fail-fast: false
matrix:
test:
- td-agent-v3.1.1.msi-test.ps1
- td-agent-v4.0.0.msi-test.ps1
- fluent-package-v5.0.1.msi-test.ps1
include:
- test: td-agent-v3.1.1.msi-test.ps1
os: windows-2019
- test: td-agent-v4.0.0.msi-test.ps1
os: windows-2019
- test: fluent-package-v5.0.1.msi-test.ps1
os: windows-latest
runs-on: ${{ matrix.os }}
name: ${{ matrix.test }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: gem
path: pkg
- name: Test
run: test/script/${{ matrix.test }}