mirror of
https://github.com/awalsh128/cache-apt-pkgs-action.git
synced 2025-09-09 04:37:38 +00:00
- Refactored README.md - Added workflows for version export and management. - Removed src directory, following Go best practices - Added COMMANDS.md documentation Saving the AI semi-slop for now with broken states to get a snapshot. Too lazy to setup another chained repo.
499 lines
18 KiB
YAML
499 lines
18 KiB
YAML
name: Test Action
|
|
|
|
on:
|
|
# Manual trigger with specific ref
|
|
workflow_dispatch:
|
|
inputs:
|
|
ref:
|
|
description: Branch, tag, SHA to test (for PRs use pull/ID/head)
|
|
required: true
|
|
type: string
|
|
debug:
|
|
description: Enable debug logging
|
|
type: boolean
|
|
required: false
|
|
default: false
|
|
|
|
# Automatic triggers
|
|
push:
|
|
branches: [dev-v2.0] # Test on pushes to dev branch
|
|
paths:
|
|
- cmd/** # Only when action code changes
|
|
- internal/** # Only when action code changes
|
|
- action.yml
|
|
- .github/workflows/action_tests.yml
|
|
pull_request:
|
|
branches: [dev-v2.0] # Test on PRs to dev branch
|
|
paths:
|
|
- cmd/** # Only when action code changes
|
|
- internal/** # Only when action code changes
|
|
- action.yml
|
|
- .github/workflows/action_tests.yml
|
|
|
|
# Environment configuration
|
|
env:
|
|
DEBUG: ${{ github.event.inputs.debug || false }}
|
|
# Test for overrides in built in shell options (regression issue 98).
|
|
SHELLOPTS: errexit:pipefail
|
|
# Use PR's SHA when testing a PR, otherwise use the ref provided
|
|
TEST_REF: ${{ github.event.pull_request.head.sha || github.event.inputs.ref || github.ref }}
|
|
|
|
jobs:
|
|
|
|
list_all_versions:
|
|
runs-on: ubuntu-latest
|
|
name: List all package versions (including deps).
|
|
steps:
|
|
# Checkout the code we want to test
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ env.TEST_REF }}
|
|
|
|
# Run the action from the checked out code
|
|
- name: Execute
|
|
id: execute
|
|
uses: ./
|
|
with:
|
|
packages: xdot=1.3-1
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-list_all_versions
|
|
debug: ${{ env.DEBUG }}
|
|
- name: Verify
|
|
if: |
|
|
steps.execute.outputs.cache-hit != 'false' ||
|
|
steps.execute.outputs.all-package-version-list != 'fonts-liberation2=1:2.1.5-3,gir1.2-atk-1.0=2.52.0-1build1,gir1.2-freedesktop=1.80.1-1,gir1.2-gdkpixbuf-2.0=2.42.10+dfsg-3ubuntu3.2,gir1.2-gtk-3.0=3.24.41-4ubuntu1.3,gir1.2-harfbuzz-0.0=8.3.0-2build2,gir1.2-pango-1.0=1.52.1+ds-1build1,graphviz=2.42.2-9ubuntu0.1,libann0=1.1.2+doc-9build1,libblas3=3.12.0-3build1.1,libcdt5=2.42.2-9ubuntu0.1,libcgraph6=2.42.2-9ubuntu0.1,libgts-0.7-5t64=0.7.6+darcs121130-5.2build1,libgts-bin=0.7.6+darcs121130-5.2build1,libgvc6=2.42.2-9ubuntu0.1,libgvpr2=2.42.2-9ubuntu0.1,libharfbuzz-gobject0=8.3.0-2build2,liblab-gamut1=2.42.2-9ubuntu0.1,liblapack3=3.12.0-3build1.1,libpangoxft-1.0-0=1.52.1+ds-1build1,libpathplan4=2.42.2-9ubuntu0.1,python3-cairo=1.25.1-2build2,python3-gi-cairo=3.48.2-1,python3-numpy=1:1.26.4+ds-6ubuntu1,xdot=1.3-1'
|
|
run: |
|
|
echo "cache-hit = ${{ steps.execute.outputs.cache-hit }}"
|
|
echo "package-version-list = ${{ steps.execute.outputs.package-version-list }}"
|
|
echo "all-package-version-list = ${{ steps.execute.outputs.all-package-version-list }}"
|
|
echo "diff all-package-version-list"
|
|
diff <(echo "${{ steps.execute.outputs.all-package-version-list }}" ) <(echo "fonts-liberation2=1:2.1.5-3,gir1.2-atk-1.0=2.52.0-1build1,gir1.2-freedesktop=1.80.1-1,gir1.2-gdkpixbuf-2.0=2.42.10+dfsg-3ubuntu3.2,gir1.2-gtk-3.0=3.24.41-4ubuntu1.3,gir1.2-harfbuzz-0.0=8.3.0-2build2,gir1.2-pango-1.0=1.52.1+ds-1build1,graphviz=2.42.2-9ubuntu0.1,libann0=1.1.2+doc-9build1,libblas3=3.12.0-3build1.1,libcdt5=2.42.2-9ubuntu0.1,libcgraph6=2.42.2-9ubuntu0.1,libgts-0.7-5t64=0.7.6+darcs121130-5.2build1,libgts-bin=0.7.6+darcs121130-5.2build1,libgvc6=2.42.2-9ubuntu0.1,libgvpr2=2.42.2-9ubuntu0.1,libharfbuzz-gobject0=8.3.0-2build2,liblab-gamut1=2.42.2-9ubuntu0.1,liblapack3=3.12.0-3build1.1,libpangoxft-1.0-0=1.52.1+ds-1build1,libpathplan4=2.42.2-9ubuntu0.1,python3-cairo=1.25.1-2build2,python3-gi-cairo=3.48.2-1,python3-numpy=1:1.26.4+ds-6ubuntu1,xdot=1.3-1")
|
|
exit 1
|
|
shell: bash
|
|
|
|
list_versions:
|
|
runs-on: ubuntu-latest
|
|
name: List package versions.
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Execute
|
|
id: execute
|
|
uses: ./
|
|
with:
|
|
packages: xdot rolldice
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-list_versions
|
|
debug: ${{ env.DEBUG }}
|
|
- name: Verify
|
|
if: steps.execute.outputs.cache-hit != 'false' || steps.execute.outputs.package-version-list != 'rolldice=1.16-1build3,xdot=1.3-1'
|
|
run: |
|
|
echo "cache-hit = ${{ steps.execute.outputs.cache-hit }}"
|
|
echo "package-version-list = ${{ steps.execute.outputs.package-version-list }}"
|
|
echo "diff package-version-list"
|
|
diff <(echo "${{ steps.execute.outputs.package-version-list }}" ) <(echo "rolldice=1.16-1build3,xdot=1.3-1")
|
|
exit 1
|
|
shell: bash
|
|
|
|
standard_workflow_install:
|
|
runs-on: ubuntu-latest
|
|
name: Standard workflow install package and cache.
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Execute
|
|
id: execute
|
|
uses: ./
|
|
with:
|
|
packages: xdot rolldice
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-standard_workflow
|
|
debug: ${{ env.DEBUG }}
|
|
- name: Verify
|
|
if: steps.execute.outputs.cache-hit != 'false'
|
|
run: |
|
|
echo "cache-hit = ${{ steps.execute.outputs.cache-hit }}"
|
|
exit 1
|
|
shell: bash
|
|
|
|
standard_workflow_install_with_new_version:
|
|
needs: standard_workflow_install
|
|
runs-on: ubuntu-latest
|
|
name: Standard workflow packages with new version.
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Execute
|
|
id: execute
|
|
uses: ./
|
|
with:
|
|
packages: xdot rolldice
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-standard_workflow_install_with_new_version
|
|
debug: ${{ env.DEBUG }}
|
|
- name: Verify
|
|
if: steps.execute.outputs.cache-hit != 'false'
|
|
run: |
|
|
echo "cache-hit = ${{ steps.execute.outputs.cache-hit }}"
|
|
exit 1
|
|
shell: bash
|
|
|
|
standard_workflow_restore:
|
|
needs: standard_workflow_install
|
|
runs-on: ubuntu-latest
|
|
name: Standard workflow restore cached packages.
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Execute
|
|
id: execute
|
|
uses: ./
|
|
with:
|
|
packages: xdot rolldice
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-standard_workflow
|
|
debug: ${{ env.DEBUG }}
|
|
- name: Verify
|
|
if: steps.execute.outputs.cache-hit != 'true'
|
|
run: |
|
|
echo "cache-hit = ${{ steps.execute.outputs.cache-hit }}"
|
|
exit 1
|
|
shell: bash
|
|
|
|
standard_workflow_restore_with_packages_out_of_order:
|
|
needs: standard_workflow_install
|
|
runs-on: ubuntu-latest
|
|
name: Standard workflow restore with packages out of order.
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Execute
|
|
id: execute
|
|
uses: ./
|
|
with:
|
|
packages: rolldice xdot
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-standard_workflow
|
|
debug: ${{ env.DEBUG }}
|
|
- name: Verify
|
|
if: steps.execute.outputs.cache-hit != 'true'
|
|
run: |
|
|
echo "cache-hit = ${{ steps.execute.outputs.cache-hit }}"
|
|
exit 1
|
|
shell: bash
|
|
|
|
standard_workflow_add_package:
|
|
needs: standard_workflow_install
|
|
runs-on: ubuntu-latest
|
|
name: Standard workflow add another package.
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Execute
|
|
id: execute
|
|
uses: ./
|
|
with:
|
|
packages: xdot rolldice distro-info-data
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-standard_workflow
|
|
debug: ${{ env.DEBUG }}
|
|
- name: Verify
|
|
if: steps.execute.outputs.cache-hit != 'false'
|
|
run: |
|
|
echo "cache-hit = ${{ steps.execute.outputs.cache-hit }}"
|
|
exit 1
|
|
shell: bash
|
|
|
|
standard_workflow_restore_add_package:
|
|
needs: standard_workflow_add_package
|
|
runs-on: ubuntu-latest
|
|
name: Standard workflow restore added package.
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Execute
|
|
id: execute
|
|
uses: ./
|
|
with:
|
|
packages: xdot rolldice distro-info-data
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-standard_workflow
|
|
debug: ${{ env.DEBUG }}
|
|
- name: Verify
|
|
if: steps.execute.outputs.cache-hit != 'true'
|
|
run: |
|
|
echo "cache-hit = ${{ steps.execute.outputs.cache-hit }}"
|
|
exit 1
|
|
shell: bash
|
|
|
|
no_packages:
|
|
runs-on: ubuntu-latest
|
|
name: No packages passed.
|
|
steps:
|
|
- name: Execute
|
|
id: execute
|
|
uses: ./
|
|
with:
|
|
packages: ""
|
|
continue-on-error: true
|
|
- name: Verify
|
|
if: steps.execute.outcome == 'failure'
|
|
run: exit 0
|
|
shell: bash
|
|
|
|
package_not_found:
|
|
runs-on: ubuntu-latest
|
|
name: Package not found.
|
|
steps:
|
|
- name: Execute
|
|
id: execute
|
|
uses: ./
|
|
with:
|
|
packages: package_that_doesnt_exist
|
|
continue-on-error: true
|
|
- name: Verify
|
|
if: steps.execute.outcome == 'failure'
|
|
run: exit 0
|
|
shell: bash
|
|
|
|
version_contains_spaces:
|
|
runs-on: ubuntu-latest
|
|
name: Version contains spaces.
|
|
steps:
|
|
- name: Execute
|
|
id: execute
|
|
uses: ./
|
|
with:
|
|
packages: xdot
|
|
version: 123 abc
|
|
debug: ${{ env.DEBUG }}
|
|
continue-on-error: true
|
|
- name: Verify
|
|
if: steps.execute.outcome == 'failure'
|
|
run: exit 0
|
|
shell: bash
|
|
|
|
regression_36:
|
|
runs-on: ubuntu-latest
|
|
name: "Reinstall existing package (regression issue #36)."
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./
|
|
with:
|
|
packages: libgtk-3-dev
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-regression_36
|
|
debug: ${{ env.DEBUG }}
|
|
|
|
regression_37:
|
|
runs-on: ubuntu-latest
|
|
name: "Install with reported package dependencies not installed (regression issue #37)."
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./
|
|
with:
|
|
packages: libosmesa6-dev libgl1-mesa-dev python3-tk pandoc git-restore-mtime
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-regression_37
|
|
debug: ${{ env.DEBUG }}
|
|
|
|
debug_disabled:
|
|
runs-on: ubuntu-latest
|
|
name: Debug disabled.
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./
|
|
with:
|
|
packages: xdot
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-list-all-package-versions
|
|
debug: ${{ env.DEBUG }}
|
|
|
|
regression_72_1:
|
|
runs-on: ubuntu-latest
|
|
name: "Cache Java CA certs package v1 (regression issue #72)."
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./
|
|
with:
|
|
packages: openjdk-11-jre
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-regression_72
|
|
debug: ${{ env.DEBUG }}
|
|
|
|
regression_72_2:
|
|
runs-on: ubuntu-latest
|
|
name: "Cache Java CA certs package v2 (regression issue #72)."
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./
|
|
with:
|
|
packages: default-jre
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-regression_72
|
|
debug: ${{ env.DEBUG }}
|
|
|
|
regression_76:
|
|
runs-on: ubuntu-latest
|
|
name: "Cache empty archive (regression issue #76)."
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: |
|
|
sudo wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null;
|
|
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list;
|
|
sudo apt-get -qq update;
|
|
sudo apt-get install -y intel-oneapi-runtime-libs intel-oneapi-runtime-opencl;
|
|
sudo apt-get install -y opencl-headers ocl-icd-opencl-dev;
|
|
sudo apt-get install -y libsundials-dev;
|
|
- uses: ./
|
|
with:
|
|
packages: intel-oneapi-runtime-libs
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-regression_76
|
|
debug: ${{ env.DEBUG }}
|
|
|
|
regression_79:
|
|
runs-on: ubuntu-latest
|
|
name: "Tar error with libboost-dev (regression issue #79)."
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./
|
|
with:
|
|
packages: libboost-dev
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-regression_79
|
|
debug: ${{ env.DEBUG }}
|
|
|
|
regression_81:
|
|
runs-on: ubuntu-latest
|
|
name: "Tar error with alsa-ucm-conf (regression issue #81)."
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./
|
|
with:
|
|
packages: libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libcups2 libdrm2 libgbm1 libnspr4 libnss3 libxcomposite1 libxdamage1 libxfixes3 libxkbcommon0 libxrandr2
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-regression_81
|
|
debug: ${{ env.DEBUG }}
|
|
|
|
regression_84_literal_block_install:
|
|
runs-on: ubuntu-latest
|
|
name: "Install multiline package listing using literal block style (regression issue #84)."
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./
|
|
with:
|
|
packages: >
|
|
xdot
|
|
rolldice distro-info-data
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-regression_84_literal_block
|
|
debug: ${{ env.DEBUG }}
|
|
|
|
regression_84_literal_block_restore:
|
|
needs: regression_84_literal_block_install
|
|
runs-on: ubuntu-latest
|
|
name: "Restore multiline package listing using literal block style (regression issue #84)."
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Execute
|
|
id: execute
|
|
uses: ./
|
|
with:
|
|
packages: xdot rolldice distro-info-data
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-regression_84_literal_block
|
|
debug: ${{ env.DEBUG }}
|
|
- name: Verify
|
|
if: steps.execute.outputs.cache-hit != 'true'
|
|
run: |
|
|
echo "cache-hit = ${{ steps.execute.outputs.cache-hit }}"
|
|
exit 1
|
|
shell: bash
|
|
|
|
regression_84_folded_block_install:
|
|
runs-on: ubuntu-latest
|
|
name: "Install multiline package listing using literal block style (regression issue #84)."
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./
|
|
with:
|
|
packages: |
|
|
xdot \
|
|
rolldice distro-info-data
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-regression_84_folded_block
|
|
debug: ${{ env.DEBUG }}
|
|
|
|
regression_84_folded_block_restore:
|
|
needs: regression_84_folded_block_install
|
|
runs-on: ubuntu-latest
|
|
name: "Restore multiline package listing using literal block style (regression issue #84)."
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Execute
|
|
id: execute
|
|
uses: ./
|
|
with:
|
|
packages: xdot rolldice distro-info-data
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-regression_84_folded_block
|
|
debug: ${{ env.DEBUG }}
|
|
- name: Verify
|
|
if: steps.execute.outputs.cache-hit != 'true'
|
|
run: |
|
|
echo "cache-hit = ${{ steps.execute.outputs.cache-hit }}"
|
|
exit 1
|
|
shell: bash
|
|
|
|
regression_89:
|
|
runs-on: ubuntu-latest
|
|
name: "Upload logs artifact name (regression issue #89)."
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./
|
|
with:
|
|
packages: libgtk-3-dev:amd64
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-regression_89
|
|
debug: ${{ env.DEBUG }}
|
|
|
|
regression_98:
|
|
runs-on: ubuntu-latest
|
|
name: "Install error due to SHELLOPTS override (regression issue #98)."
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./
|
|
with:
|
|
packages: git-restore-mtime libgl1-mesa-dev libosmesa6-dev pandoc
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-regression_98
|
|
debug: ${{ env.DEBUG }}
|
|
|
|
regression_106_install:
|
|
runs-on: ubuntu-latest
|
|
name: "Stale apt repo not finding package on restore, install phase (regression issue #106)."
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./
|
|
with:
|
|
packages: libtk8.6
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-regression_106
|
|
debug: ${{ env.DEBUG }}
|
|
|
|
regression_106_restore:
|
|
needs: regression_106_install
|
|
runs-on: ubuntu-latest
|
|
name: "Stale apt repo not finding package on restore, restore phase (regression issue #106)."
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./
|
|
with:
|
|
packages: libtk8.6
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-regression_106
|
|
debug: ${{ env.DEBUG }}
|
|
|
|
regression_159_install:
|
|
runs-on: ubuntu-latest
|
|
name: apt-show false positive parsing Package line (regression issue #159).
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./
|
|
with:
|
|
packages: texlive-latex-extra
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-regression_159
|
|
debug: ${{ env.DEBUG }}
|
|
|
|
multi_arch_cache_key:
|
|
runs-on: ubuntu-latest
|
|
name: Cache packages with multi-arch cache key.
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./
|
|
with:
|
|
packages: libfuse2
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-multi_arch_cache_key
|
|
debug: ${{ env.DEBUG }}
|
|
|
|
virtual_package:
|
|
runs-on: ubuntu-latest
|
|
name: Cache virtual package.
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./
|
|
with:
|
|
packages: libvips
|
|
version: ${{ github.run_id }}-${{ github.run_attempt }}-virtual_package
|
|
debug: ${{ env.DEBUG }} |