-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (82 loc) · 2.59 KB
/
ci.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
name: CI
on:
push:
tags: ["v*.*.*"]
branches: [main]
pull_request:
branches: [main]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: pre-commit/[email protected]
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- run: make install
- run: make lint
test:
if: >
github.event_name != 'pull_request' ||
github.event.pull_request.draft == false
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
image:
- ubuntu:focal
- debian:bullseye
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.image }}
cancel-in-progress: true
steps:
- name: Install podman
run: |
REPO_URL="http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_22.04/"
REPO_KEY_URL="http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_22.04/Release.key"
REPO_KEY_FILE="/etc/apt/keyrings/podman.gpg"
REPO_FILE="/etc/apt/sources.list.d/podman.list"
sudo mkdir -p "$(dirname "$REPO_KEY_FILE")"
curl -fsSL "$REPO_KEY_URL" | sudo gpg --dearmor -o "$REPO_KEY_FILE"
echo "deb [arch=amd64 signed-by=$REPO_KEY_FILE] $REPO_URL /" | sudo tee "$REPO_FILE"
sudo apt-get -q update
sudo apt-get -q install -y podman fuse-overlayfs
podman info
env:
DEBIAN_FRONTEND: noninteractive
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v4
with:
path: |
~/.ansible/collections
~/.ansible/roles
key: ${{ runner.os }}-ansible-${{ hashFiles('**/requirements.yml') }}
- run: make install
- run: make test
env:
PY_COLORS: true
ANSIBLE_FORCE_COLOR: true
MOLECULE_IMAGE: ${{ matrix.image }}