From 4b4922e1b6fa6a7b8da16b38ff45b2bcd71b5e32 Mon Sep 17 00:00:00 2001 From: Timothy Stewart Date: Sun, 21 Jan 2024 15:11:38 -0600 Subject: [PATCH] fix(ci): adjusting cache steps --- .github/workflows/cache.yml | 14 ++++++++++++++ .github/workflows/ci.yml | 8 ++++---- .github/workflows/lint.yml | 6 ++---- .github/workflows/test.yml | 9 +-------- roles/k3s_server_post/defaults/main.yml | 2 +- 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml index 2977b87..3233921 100644 --- a/.github/workflows/cache.yml +++ b/.github/workflows/cache.yml @@ -15,6 +15,20 @@ jobs: 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 Ansible + uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # 4.0 + with: + path: ~/.ansible/collections + key: ${{ runner.os }}-ansible-${{ hashFiles('collections/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-ansible- + - name: Update Homebrew run: | brew update --preinstall diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d2fef5..c0b3b36 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,11 +8,11 @@ on: paths-ignore: - '**/README.md' jobs: - lint: - uses: ./.github/workflows/lint.yml cache: uses: ./.github/workflows/cache.yml - needs: [lint] + lint: + uses: ./.github/workflows/lint.yml + needs: [cache] test: uses: ./.github/workflows/test.yml - needs: [lint, cache] + needs: [cache, lint] diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4f7b4c3..40b0487 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,13 +21,11 @@ jobs: python-version: ${{ env.PYTHON_VERSION }} cache: 'pip' # caching pip dependencies - - name: Cache Ansible - uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # 4.0 + - 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- - name: Install dependencies run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c9bea73..9fb4ea0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -58,13 +58,6 @@ jobs: * fdad:bad:ba55::/64 EOF - - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@75f3110429a8c05be0e1bf360334e4cced2b63fa # 2.3.3 - id: pip-cache - with: - python-version: ${{ env.PYTHON_VERSION }} - cache: 'pip' # caching pip dependencies - - name: Install dependencies run: | echo "::group::Upgrade pip" @@ -89,7 +82,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 diff --git a/roles/k3s_server_post/defaults/main.yml b/roles/k3s_server_post/defaults/main.yml index 1c458fa..bbf9629 100644 --- a/roles/k3s_server_post/defaults/main.yml +++ b/roles/k3s_server_post/defaults/main.yml @@ -1,6 +1,6 @@ --- # Timeout to wait for MetalLB services to come up -metal_lb_available_timeout: 120s +metal_lb_available_timeout: 240s # Name of the master group group_name_master: master