mirror of
https://github.com/techno-tim/k3s-ansible.git
synced 2025-12-28 11:42:37 +01:00
fix(ci): adjusting cache steps
This commit is contained in:
24
.github/add-boxes.sh
vendored
24
.github/add-boxes.sh
vendored
@@ -1,24 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# add-boxes.sh
|
|
||||||
# list add boxes on system and add
|
|
||||||
# already present on the system.
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
PROVIDER=virtualbox
|
|
||||||
|
|
||||||
# Read the boxes that are currently present on the system (for the current provider)
|
|
||||||
present_boxes=$(
|
|
||||||
(vagrant box list |
|
|
||||||
grep "${PROVIDER}" | # Filter by boxes available for the current provider
|
|
||||||
awk '{print $1;}' | # The box name is the first word in each line
|
|
||||||
sort |
|
|
||||||
uniq) ||
|
|
||||||
echo "" # In case any of these commands fails, just use an empty list
|
|
||||||
)
|
|
||||||
|
|
||||||
# Add all boxes
|
|
||||||
echo "${present_boxes}" | while IFS= read -r box; do
|
|
||||||
vagrant box add --provider "${PROVIDER}" "${box}"
|
|
||||||
done
|
|
||||||
38
.github/workflows/cache.yml
vendored
38
.github/workflows/cache.yml
vendored
@@ -5,7 +5,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
molecule:
|
molecule:
|
||||||
name: cache
|
name: cache
|
||||||
runs-on: macos-12
|
runs-on: macos-13
|
||||||
env:
|
env:
|
||||||
PYTHON_VERSION: "3.11"
|
PYTHON_VERSION: "3.11"
|
||||||
|
|
||||||
@@ -58,26 +58,26 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
vagrant-boxes
|
vagrant-boxes
|
||||||
|
|
||||||
# - name: Configure Homebrew cache
|
- name: Configure Homebrew cache
|
||||||
# uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # 4.0
|
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # 4.0
|
||||||
# id: cache-homebrew
|
id: cache-homebrew
|
||||||
# with:
|
with:
|
||||||
# path: |
|
path: |
|
||||||
# ~/Library/Caches/Homebrew
|
~/Library/Caches/Homebrew
|
||||||
# key: brew-${{ hashFiles('./Brewfile') }}
|
key: brew-${{ hashFiles('./Brewfile') }}
|
||||||
# restore-keys: brew-
|
restore-keys: brew-
|
||||||
|
|
||||||
# - name: Update Homebrew
|
- name: Update Homebrew
|
||||||
# if: | # only run if false since this is just a cache step
|
if: | # only run if false since this is just a cache step
|
||||||
# steps.cache-homebrew.outputs.cache-hit != 'true' || steps.cache-homebrew.outputs.cache-hit != 'true'
|
steps.cache-homebrew.outputs.cache-hit != 'true' || steps.cache-homebrew.outputs.cache-hit != 'true'
|
||||||
# run: |
|
run: |
|
||||||
# brew update --preinstall
|
brew update --preinstall
|
||||||
|
|
||||||
# - name: Install Homebrew dependencies
|
- name: Install Homebrew dependencies
|
||||||
# if: | # only run if false since this is just a cache step
|
if: | # only run if false since this is just a cache step
|
||||||
# steps.cache-homebrew.outputs.cache-hit != 'true' || steps.cache-homebrew.outputs.cache-hit != 'true'
|
steps.cache-homebrew.outputs.cache-hit != 'true' || steps.cache-homebrew.outputs.cache-hit != 'true'
|
||||||
# run: |
|
run: |
|
||||||
# env HOMEBREW_NO_AUTO_UPDATE=1 brew bundle --no-upgrade --file ./Brewfile
|
env HOMEBREW_NO_AUTO_UPDATE=1 brew bundle --no-upgrade --file ./Brewfile
|
||||||
|
|
||||||
- name: Download Vagrant boxes for all scenarios
|
- name: Download Vagrant boxes for all scenarios
|
||||||
# To save some cache space, all scenarios share the same cache key.
|
# To save some cache space, all scenarios share the same cache key.
|
||||||
|
|||||||
4
.github/workflows/lint.yml
vendored
4
.github/workflows/lint.yml
vendored
@@ -5,7 +5,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
pre-commit-ci:
|
pre-commit-ci:
|
||||||
name: Pre-Commit
|
name: Pre-Commit
|
||||||
runs-on: macos-12
|
runs-on: macos-13
|
||||||
env:
|
env:
|
||||||
PYTHON_VERSION: "3.11"
|
PYTHON_VERSION: "3.11"
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ jobs:
|
|||||||
|
|
||||||
ensure-pinned-actions:
|
ensure-pinned-actions:
|
||||||
name: Ensure SHA Pinned Actions
|
name: Ensure SHA Pinned Actions
|
||||||
runs-on: macos-12
|
runs-on: macos-13
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791 # v3 2.5.0
|
uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791 # v3 2.5.0
|
||||||
|
|||||||
33
.github/workflows/test.yml
vendored
33
.github/workflows/test.yml
vendored
@@ -5,7 +5,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
molecule:
|
molecule:
|
||||||
name: Molecule
|
name: Molecule
|
||||||
runs-on: macos-12
|
runs-on: macos-13
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
scenario:
|
scenario:
|
||||||
@@ -22,25 +22,19 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
- name: Restore Ansible cache
|
- name: Restore Homebrew cache
|
||||||
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # 4.0
|
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # 4.0
|
||||||
with:
|
with:
|
||||||
path: ~/.ansible/collections
|
path: ~/Library/Caches/Homebrew
|
||||||
key: ansible-${{ hashFiles('collections/requirements.yml') }}
|
key: brew-${{ hashFiles('./Brewfile') }}
|
||||||
|
|
||||||
# - name: Restore Homebrew cache
|
- name: Update Homebrew
|
||||||
# uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # 4.0
|
run: |
|
||||||
# with:
|
brew update --preinstall
|
||||||
# path: ~/Library/Caches/Homebrew
|
|
||||||
# key: brew-${{ hashFiles('./Brewfile') }}
|
|
||||||
|
|
||||||
# - name: Update Homebrew
|
- name: Install Homebrew dependencies
|
||||||
# run: |
|
run: |
|
||||||
# brew update --preinstall
|
env HOMEBREW_NO_AUTO_UPDATE=1 brew bundle --no-upgrade --file ./Brewfile
|
||||||
|
|
||||||
# - name: Install Homebrew dependencies
|
|
||||||
# run: |
|
|
||||||
# env HOMEBREW_NO_AUTO_UPDATE=1 brew bundle --no-upgrade --file ./Brewfile
|
|
||||||
|
|
||||||
- name: Restore vagrant Boxes cache
|
- name: Restore vagrant Boxes cache
|
||||||
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # 4.0
|
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # 4.0
|
||||||
@@ -57,9 +51,6 @@ jobs:
|
|||||||
* fdad:bad:ba55::/64
|
* fdad:bad:ba55::/64
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
- name: Add Vagrant Boxes
|
|
||||||
run: ./.github/add-boxes.sh
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
echo "::group::Upgrade pip"
|
echo "::group::Upgrade pip"
|
||||||
@@ -70,10 +61,6 @@ jobs:
|
|||||||
python3 -m pip install -r requirements.txt
|
python3 -m pip install -r requirements.txt
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
echo "::group::Install Ansible role requirements from collections/requirements.yml"
|
|
||||||
ansible-galaxy install -r collections/requirements.yml
|
|
||||||
echo "::endgroup::"
|
|
||||||
|
|
||||||
- name: Test with molecule
|
- name: Test with molecule
|
||||||
run: molecule test --scenario-name ${{ matrix.scenario }}
|
run: molecule test --scenario-name ${{ matrix.scenario }}
|
||||||
timeout-minutes: 90
|
timeout-minutes: 90
|
||||||
|
|||||||
Reference in New Issue
Block a user