forked from openedx-unsupported/devstack
-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (62 loc) · 2.2 KB
/
cli-tests.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
# CLI tests: Check that various Makefile targets behave as expected
# (without going deeper into provisioning and such)
name: CLI tests
on:
push:
branches: [master]
pull_request:
branches:
- '**'
jobs:
run_ci:
runs-on: ${{ matrix.os.image }}
env:
DEVSTACK_WORKSPACE: /tmp
SHALLOW_CLONE: 1
# Don't report metrics as real usage
DEVSTACK_METRICS_TESTING: ci
strategy:
matrix:
os:
- name: linux
image: ubuntu-20.04 # Focal Fossa
- name: mac
image: macos-13
python-version:
- '3.11'
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Docker installation - Linux
if: ${{ matrix.os.name == 'linux' }}
run: |
docker version
sudo apt-get update
sudo apt install apt-transport-https ca-certificates curl 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 focal test"
sudo apt update
sudo apt install docker-ce containerd.io
docker version
docker compose --version
# Note: we cannot use Docker Desktop because it has not been licensed for use in GithubActions
- name: Docker installation - Mac
if: ${{ matrix.os.name == 'mac' }}
run: |
brew install colima docker docker-compose
colima start -a vz -m 8 -r docker
echo "DOCKER_HOST=unix://${HOME}/.colima/docker.sock" >> $GITHUB_ENV
mkdir -p ~/.docker/cli-plugins
ln -sfn /usr/local/bin/docker-compose ~/.docker/cli-plugins/docker-compose
- name: Install Python dependencies
run: make requirements
# proactively download and extract the image to avoid test timeouts in tests/metrics.py
# this should be moved into a test setup
- name: Pull redis docker image
run: make dev.pull.redis
- name: CLI tests
run: pytest -s ./tests/*.py