Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI #389

Merged
merged 88 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
ac4a6e7
fix(molecule): Reducing cores and memory
timothystewart6 Jan 21, 2024
fecf7c7
fix(molecule): Reducing cores and memory
timothystewart6 Jan 21, 2024
9084c90
fix(ci): Add a cache prestep
timothystewart6 Jan 21, 2024
867eabc
fix(ci): Add a cache prestep
timothystewart6 Jan 21, 2024
20ea0bc
fix(ci): Add a cache prestep
timothystewart6 Jan 21, 2024
f54eb1b
fix(ci): Add a cache prestep
timothystewart6 Jan 21, 2024
7a8c7ec
fix(ci): Add a cache prestep
timothystewart6 Jan 21, 2024
7cfcd97
fix(ci): Add a cache prestep
timothystewart6 Jan 21, 2024
a2d4e91
fix(ci): Add a cache prestep
timothystewart6 Jan 21, 2024
3bb8984
fix(ci): Add a cache prestep
timothystewart6 Jan 21, 2024
f2b87ec
fix(ci): move to macos13
timothystewart6 Jan 21, 2024
0715ab9
fix(ci): move to macos13
timothystewart6 Jan 21, 2024
b7248f8
fix(ci): move to macos13
timothystewart6 Jan 21, 2024
3345de2
fix(ci): move to macos13
timothystewart6 Jan 21, 2024
50d60e6
fix(ci): move to macos13
timothystewart6 Jan 21, 2024
9117ec4
fix(ci): move to macos13
timothystewart6 Jan 21, 2024
0c640c5
fix(ci): move to macos13
timothystewart6 Jan 21, 2024
5b7794c
fix(ci): move to macos13
timothystewart6 Jan 21, 2024
10f545f
fix(ci): move to macos13
timothystewart6 Jan 21, 2024
68f8f20
fix(ci): move to macos13
timothystewart6 Jan 21, 2024
03e0d00
fix(ci): move to macos13
timothystewart6 Jan 21, 2024
272e9cd
fix(ci): move to macos13
timothystewart6 Jan 21, 2024
22a6177
fix(ci): move to macos13
timothystewart6 Jan 21, 2024
0e233e1
fix(ci): move to macos13
timothystewart6 Jan 21, 2024
f07009e
fix(ci): move to macos13
timothystewart6 Jan 21, 2024
4b4922e
fix(ci): adjusting cache steps
timothystewart6 Jan 21, 2024
7c1b17a
fix(ci): adjusting cache steps
timothystewart6 Jan 21, 2024
2333e85
fix(ci): adjusting cache steps
timothystewart6 Jan 21, 2024
c3597a9
fix(ci): adjusting cache steps
timothystewart6 Jan 21, 2024
d66e745
fix(ci): adjusting cache steps
timothystewart6 Jan 21, 2024
dfdcff7
fix(ci): adjusting cache steps
timothystewart6 Jan 21, 2024
eb7046f
fix(ci): adjusting cache steps
timothystewart6 Jan 21, 2024
0c4bafa
fix(ci): adjusting cache steps
timothystewart6 Jan 21, 2024
f8e408b
fix(ci): adjusting cache steps
timothystewart6 Jan 21, 2024
980622f
fix(ci): adjusting cache steps
timothystewart6 Jan 21, 2024
5cc46eb
fix(ci): adjusting cache steps
timothystewart6 Jan 21, 2024
f767c32
fix(ci): adjusting cache steps
timothystewart6 Jan 21, 2024
cdfee6f
fix(ci): adjusting cache steps
timothystewart6 Jan 21, 2024
7f7e0e7
fix(ci): adjusting cache steps
timothystewart6 Jan 21, 2024
82d3657
fix(ci): adjusting cache steps
timothystewart6 Jan 21, 2024
f6597e8
fix(ci): adjusting cache steps
timothystewart6 Jan 21, 2024
4f635eb
fix(ci): adjusting cache steps
timothystewart6 Jan 21, 2024
59e7692
fix(ci): adjusting cache steps
timothystewart6 Jan 21, 2024
5a36416
fix(ci): adjusting cache steps
timothystewart6 Jan 21, 2024
4b8c97c
fix(ci): adjusting cache steps
timothystewart6 Jan 22, 2024
eb89255
fix(ci): adjusting cache steps
timothystewart6 Jan 22, 2024
f7869f4
fix(ci): adjusting cache steps
timothystewart6 Jan 22, 2024
fc8ab77
fix(ci): adjusting cache steps
timothystewart6 Jan 22, 2024
8acec70
fix(ci): adjusting cache steps
timothystewart6 Jan 22, 2024
b9d94f3
fix(ci): adjusting cache steps
timothystewart6 Jan 22, 2024
0ae666d
fix(post): Fix liquid formatting
timothystewart6 Jan 22, 2024
ffcc793
fix(ci): adjusting cache steps
timothystewart6 Jan 22, 2024
4707002
fix(ci): adjusting cache steps
timothystewart6 Jan 22, 2024
27c477b
fix(molecule): reduce resources
timothystewart6 Jan 22, 2024
c59d4c5
fix(pip): updating dependencies
timothystewart6 Jan 22, 2024
74ca472
fix(molecule): remove lint
timothystewart6 Jan 22, 2024
c9f50a7
fix(ci): fix homebrew
timothystewart6 Jan 22, 2024
4d1d11b
fix(ci): fix homebrew
timothystewart6 Jan 22, 2024
a83078d
fix(ci): fix homebrew
timothystewart6 Jan 22, 2024
647a3a8
fix(ci): fix homebrew
timothystewart6 Jan 22, 2024
d786f61
fix(ci): fix homebrew
timothystewart6 Jan 22, 2024
3409f0d
fix(ci): fix homebrew
timothystewart6 Jan 22, 2024
8dc6b76
fix(ci): fix homebrew
timothystewart6 Jan 22, 2024
bdc5d09
fix(ci): fix homebrew
timothystewart6 Jan 22, 2024
01d4bb8
fix(ci): fix molecule
timothystewart6 Jan 23, 2024
7a2062a
fix(ci): fix molecule
timothystewart6 Jan 23, 2024
40d7a0b
fix(ci): fix molecule
timothystewart6 Jan 23, 2024
31b3686
fix(ci): fix molecule
timothystewart6 Jan 23, 2024
62d37e1
fix(ci): fix molecule
timothystewart6 Jan 23, 2024
c8efd7d
fix(ci): fix molecule
timothystewart6 Jan 23, 2024
b00f020
fix(ci): fix molecule
timothystewart6 Jan 23, 2024
83c5866
fix(ci): fix molecule
timothystewart6 Jan 23, 2024
b928c93
fix(ci): fix molecule
timothystewart6 Jan 23, 2024
e0ecd44
fix(ci): fix molecule
timothystewart6 Jan 23, 2024
d7a9a8d
fix(ci): fix molecule
timothystewart6 Jan 23, 2024
ddcbead
fix(ci): fix molecule
timothystewart6 Jan 23, 2024
f239f8e
fix(ci): fix molecule
timothystewart6 Jan 23, 2024
e5a1da1
fix(ci): testing with macos-12
timothystewart6 Jan 23, 2024
c54a1c6
fix(ci): move to ubuntu
timothystewart6 Jan 23, 2024
903f302
fix(ci): move to ubuntu
timothystewart6 Jan 23, 2024
fd026d6
fix(ci): self-hosted
timothystewart6 Jan 24, 2024
2d0716b
fix(ci): self-hosted
timothystewart6 Jan 24, 2024
069b9b1
fix(ci): self-hosted
timothystewart6 Jan 24, 2024
675b6f6
fix(ci): self-hosted
timothystewart6 Jan 24, 2024
2bc85be
fix(ci): self-hosted
timothystewart6 Jan 24, 2024
e63e207
fix(ci): self-hosted
timothystewart6 Jan 25, 2024
634fbb6
fix(ci): only run jobs that require self-hosted runners
timothystewart6 Jan 25, 2024
0589160
fix(ci): mnevermind
timothystewart6 Jan 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: "Cache"
on:
workflow_call:
jobs:
molecule:
name: cache
runs-on: self-hosted
env:
PYTHON_VERSION: "3.11"

steps:
- name: Check out the codebase
uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791 # v3 2.5.0
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@75f3110429a8c05be0e1bf360334e4cced2b63fa # 2.3.3
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip' # caching pip dependencies

- name: Cache Vagrant boxes
id: cache-vagrant
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # 4.0
with:
lookup-only: true #if it exists, we don't need to restore and can skip the next step
path: |
~/.vagrant.d/boxes
key: vagrant-boxes-${{ hashFiles('**/molecule.yml') }}
restore-keys: |
vagrant-boxes

- name: Download Vagrant boxes for all scenarios
# To save some cache space, all scenarios share the same cache key.
# On the other hand, this means that the cache contents should be
# the same across all scenarios. This step ensures that.
if: steps.cache-vagrant.outputs.cache-hit != 'true' # only run if false since this is just a cache step
run: |
./.github/download-boxes.sh
vagrant box list
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ on:
paths-ignore:
- '**/README.md'
jobs:
pre:
uses: ./.github/workflows/cache.yml
lint:
uses: ./.github/workflows/lint.yml
needs: [pre]
test:
uses: ./.github/workflows/test.yml
needs: [lint]
needs: [pre, lint]
24 changes: 5 additions & 19 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
jobs:
pre-commit-ci:
name: Pre-Commit
runs-on: ubuntu-latest
runs-on: self-hosted
env:
PYTHON_VERSION: "3.11"

Expand All @@ -21,21 +21,11 @@ jobs:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip' # caching pip dependencies

- name: Cache pip
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # 3.0.11
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('./requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Cache Ansible
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # 3.0.11
- name: Restore Ansible cache
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # 4.0
with:
path: ~/.ansible/collections
key: ${{ runner.os }}-ansible-${{ hashFiles('collections/requirements.txt') }}
restore-keys: |
${{ runner.os }}-ansible-
key: ansible-${{ hashFiles('collections/requirements.yml') }}

- name: Install dependencies
run: |
Expand All @@ -47,16 +37,12 @@ jobs:
python3 -m pip install -r requirements.txt
echo "::endgroup::"

echo "::group::Install Ansible role requirements from collections/requirements.yml"
ansible-galaxy install -r collections/requirements.yml
echo "::endgroup::"

- name: Run pre-commit
uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507 # 3.0.0

ensure-pinned-actions:
name: Ensure SHA Pinned Actions
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791 # v3 2.5.0
Expand Down
34 changes: 9 additions & 25 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
jobs:
molecule:
name: Molecule
runs-on: macos-12
runs-on: self-hosted
strategy:
matrix:
scenario:
Expand All @@ -30,35 +30,19 @@ jobs:
* fdad:bad:ba55::/64
EOF

- name: Cache pip
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # 3.0.11
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('./requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Cache Vagrant boxes
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # 3.0.11
with:
path: |
~/.vagrant.d/boxes
key: vagrant-boxes-${{ hashFiles('**/molecule.yml') }}
restore-keys: |
vagrant-boxes

- name: Download Vagrant boxes for all scenarios
# To save some cache space, all scenarios share the same cache key.
# On the other hand, this means that the cache contents should be
# the same across all scenarios. This step ensures that.
run: ./.github/download-boxes.sh

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@75f3110429a8c05be0e1bf360334e4cced2b63fa # 2.3.3
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip' # caching pip dependencies

- name: Restore vagrant Boxes cache
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # 4.0
with:
path: ~/.vagrant.d/boxes
key: vagrant-boxes-${{ hashFiles('**/molecule.yml') }}
fail-on-cache-miss: true

- name: Install dependencies
run: |
echo "::group::Upgrade pip"
Expand All @@ -75,7 +59,7 @@ jobs:
env:
ANSIBLE_K3S_LOG_DIR: ${{ runner.temp }}/logs/k3s-ansible/${{ matrix.scenario }}
ANSIBLE_SSH_RETRIES: 4
ANSIBLE_TIMEOUT: 60
ANSIBLE_TIMEOUT: 120
PY_COLORS: 1
ANSIBLE_FORCE_COLOR: 1

Expand Down
13 changes: 7 additions & 6 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ platforms:

- name: control1
box: generic/ubuntu2204
memory: 2048
memory: 4096
cpus: 2
groups:
- k3s_cluster
Expand All @@ -23,7 +23,7 @@ platforms:

- name: control2
box: generic/debian11
memory: 2048
memory: 4096
cpus: 2
groups:
- k3s_cluster
Expand All @@ -34,7 +34,7 @@ platforms:

- name: control3
box: generic/rocky9
memory: 2048
memory: 4096
cpus: 2
groups:
- k3s_cluster
Expand All @@ -45,7 +45,7 @@ platforms:

- name: node1
box: generic/ubuntu2204
memory: 2048
memory: 4096
cpus: 2
groups:
- k3s_cluster
Expand All @@ -61,7 +61,7 @@ platforms:

- name: node2
box: generic/rocky9
memory: 2048
memory: 4096
cpus: 2
groups:
- k3s_cluster
Expand All @@ -72,6 +72,8 @@ platforms:

provisioner:
name: ansible
env:
ANSIBLE_VERBOSITY: 1
playbooks:
converge: ../resources/converge.yml
side_effect: ../resources/reset.yml
Expand All @@ -82,7 +84,6 @@ provisioner:
scenario:
test_sequence:
- dependency
- lint
- cleanup
- destroy
- syntax
Expand Down
9 changes: 5 additions & 4 deletions molecule/ipv6/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ driver:
platforms:
- name: control1
box: generic/ubuntu2204
memory: 2048
memory: 4096
cpus: 2
groups:
- k3s_cluster
Expand All @@ -22,7 +22,7 @@ platforms:

- name: control2
box: generic/ubuntu2204
memory: 2048
memory: 4096
cpus: 2
groups:
- k3s_cluster
Expand All @@ -38,7 +38,7 @@ platforms:

- name: node1
box: generic/ubuntu2204
memory: 2048
memory: 4096
cpus: 2
groups:
- k3s_cluster
Expand All @@ -53,6 +53,8 @@ platforms:
ssh.password: "vagrant"
provisioner:
name: ansible
env:
ANSIBLE_VERBOSITY: 1
playbooks:
converge: ../resources/converge.yml
side_effect: ../resources/reset.yml
Expand All @@ -63,7 +65,6 @@ provisioner:
scenario:
test_sequence:
- dependency
- lint
- cleanup
- destroy
- syntax
Expand Down
7 changes: 4 additions & 3 deletions molecule/single_node/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ driver:
platforms:
- name: control1
box: generic/ubuntu2204
memory: 4096
cpus: 4
memory: 8192
cpus: 8
config_options:
# We currently can not use public-key based authentication on Ubuntu 22.04,
# see: https://github.com/chef/bento/issues/1405
Expand All @@ -21,6 +21,8 @@ platforms:
ip: 192.168.30.50
provisioner:
name: ansible
env:
ANSIBLE_VERBOSITY: 1
playbooks:
converge: ../resources/converge.yml
side_effect: ../resources/reset.yml
Expand All @@ -31,7 +33,6 @@ provisioner:
scenario:
test_sequence:
- dependency
- lint
- cleanup
- destroy
- syntax
Expand Down
18 changes: 9 additions & 9 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
ansible-core>=2.13.5
ansible-core>=2.16.2
jmespath>=1.0.1
jsonpatch>=1.32
kubernetes>=25.3.0
molecule-vagrant>=1.0.0
molecule>=4.0.3
netaddr>=0.8.0
pre-commit>=2.20.0
pre-commit-hooks>=1.3.1
pyyaml>=6.0
jsonpatch>=1.33
kubernetes>=29.0.0
molecule-plugins[vagrant]
molecule>=6.0.3
netaddr>=0.10.1
pre-commit>=3.6.0
pre-commit-hooks>=4.5.0
pyyaml>=6.0.1
Loading
Loading