Skip to content

install-and-cache apt tools

Actions
GitHub Action to install and cache apt tools
v1.5
Latest
Star (3)

actions-use-apt-tools

actions-use-apt-tools

This GitHub action installs Linux APT packages and cache them for later use. When executed next time with same package list, and any other environment are not changed, installed files are extracted from the cached archive.

When valid cached archive is not found, all packages are installed by apt-get command. If you want partial install/cache behavior, use this action multiple times.

There are two different methods to identify installed files. Default is package method, and files are taken by dpkg -L command. This method runs very fast. For packages generate files during installation, use timestamp method, and all files those have newer timestamp are cached. Files are searched under /etc, /usr/{bin,sbin,lib,share} and /var/lib directory. Search directries can be given by path parameter.

Output is same as @actions/cache.

Usage

# inputs:
#   tools:  { required: true,  type: string }
#   repos:  { required: false, type: string }
#   cache:  { required: false, type: string, default: yes }
#   key:    { required: false, type: string }
#   method: { required: false, type: string, default: package }
#   path:   { required: false, type: string,
#             default: "/etc /usr/bin /usr/sbin /usr/lib /usr/share /var/lib" }

- uses: tecolicom/actions-use-apt-tools@v1
  with:

    # apt packages
    tools: ''

    # additional repositories
    repos: ''

    # Cache strategy
    #
    # yes:      activate cache
    # no:       no cache
    # workflow: effective within same workflow (mainly for test)
    #
    cache: yes

    # Additional cache key
    key: ''

    # Method to idenfity installed files
    #   package:   use "dpkg -L" command output
    #   timestamp: use file's timestamps to check update
    method: package

    # Search path with "timestamp" method
    path: ''

Example

Normal case with default package method

- uses: tecolicom/actions-use-apt-tools@v1
  with:
    tools: bmake

Using timestamp method

For packages which generates additional files other than included in package during installation, use timestamp method. If you know where they will be placed, provide them by a path parameter.

- uses: tecolicom/actions-use-apt-tools@v1
  with:
    tools: mecab mecab-ipadic mecab-ipadic-utf8
    method: timestamp

Add repositories

      - uses: tecolicom/actions-use-apt-tools@v1
        id: action
        with:
          tools: g++-11
          repos: ppa:ubuntu-toolchain-r/test
          method: timestamp

See Also

install-and-cache apt tools is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

GitHub Action to install and cache apt tools
v1.5
Latest

install-and-cache apt tools is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.