-
Notifications
You must be signed in to change notification settings - Fork 288
87 lines (86 loc) · 2.36 KB
/
unit_test.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
name: Unit Tests
on:
push:
branches:
# A test branch for seeing if your tests will pass in your personal fork
- test_me_github
pull_request:
branches:
- main
- master
jobs:
docker-rspec:
runs-on:
- ubuntu-latest
strategy:
matrix:
ruby:
- 3.3
- 3.2
- 3.1
- '3.0'
- 2.7
- 2.6
- 2.5
- 2.4
docker_version:
- ':26.'
- ':27.'
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Update gems
run: bundle update
- name: install docker
env:
DOCKER_VERSION: ${{ matrix.docker_version }}
run: |
set -x
sudo apt-get remove -y docker docker-engine docker.io containerd runc ||:
sudo apt-get update -y
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update -y
sudo apt-cache gencaches
sudo apt-get install -y docker-ce=$( apt-cache madison docker-ce | grep -e $DOCKER_VERSION | cut -f 2 -d '|' | head -1 | sed 's/\s//g' )
if [ $? -ne 0 ]; then
echo "Error: Could not install ${DOCKER_VERSION}"
echo "Available docker versions:"
apt-cache madison docker-ce
exit 1
fi
sudo systemctl start docker
- name: spec tests
run: bundle exec rake
podman-rspec:
runs-on:
- ubuntu-latest
strategy:
matrix:
ruby:
- 3.3
- 3.2
- 3.1
- '3.0'
- 2.7
- 2.6
- 2.5
- 2.4
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Update gems
run: bundle update
- name: install podman
run: sudo ./script/install_podman.sh
- name: spec tests
run: bundle exec rake