Linux + upstream GitHub xz #51
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Linux + upstream GitHub xz | |
on: | |
workflow_dispatch: | |
push: | |
pull_request: | |
schedule: | |
- cron: '02 02 * * 6' # Run every Saturday | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
perl: | |
- '5.38' | |
lzma-version: | |
- v5.4.4 | |
- v5.4.3 | |
- v5.4.2 | |
- v5.4.1 | |
- v5.4.0 | |
- v5.2.12 | |
- v5.2.11 | |
- v5.2.10 | |
# - v5.0.7 | |
- master | |
env: | |
lzma-source: ${{ github.workspace }}/upstream-lzma-source | |
lzma-install: ${{ github.workspace }}/upstream-lzma-install | |
LIBLZMA_LIB: ${{ github.workspace }}/upstream-lzma-install/lib | |
LIBLZMA_INCLUDE: ${{ github.workspace }}/upstream-lzma-install/include | |
LZMA_VERSION: ${{ matrix.lzma-version }} | |
# Run each step if | |
# 1. Not a scheduled job | |
# 2. Is sheduled AND zlib 'develop' | |
STEP_ENABLED: ${{ ( github.event_name != 'schedule' || ( github.event_name == 'schedule' && matrix.lzma-version == 'master' ) ) && true || '' }} | |
defaults: | |
run: | |
working-directory: repo | |
name: Perl ${{ matrix.perl }} with lzma ${{matrix.lzma-version}} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
path: repo | |
- name: Make Paths | |
if: env.STEP_ENABLED | |
run: | | |
mkdir -p ${{ env.lzma-source }} | |
mkdir -p ${{ env.lzma-install }} | |
mkdir -p ${{ github.workspace }}/repo | |
- name: Cache lzma ${{matrix.lzma-version}} | |
if: env.STEP_ENABLED && matrix.lzma-version != 'master' | |
id: cache-lzma | |
uses: actions/cache@v3 | |
with: | |
# NOTE: path doesn't expand variables! | |
path: upstream-lzma-install | |
key: ${{ runner.os }}-lzma-${{ matrix.lzma-version }} | |
- name: Checkout upstream lzma ${{matrix.lzma-version}} | |
if: env.STEP_ENABLED && steps.cache-lzma.outputs.cache-hit != 'true' | |
uses: actions/checkout@v3 | |
with: | |
repository: tukaani-project/xz | |
ref: ${{ matrix.lzma-version }} | |
path: ${{ env.lzma-source }} | |
# # Install Autotools on Linux | |
# - name: Install autogen Dependencies | |
# run: | | |
# sudo apt-get update | |
# sudo apt-get install -y autoconf automake build-essential po4a autopoint gcc-multilib doxygen | |
# Configure-based build | |
# - name: Build lzma ${{matrix.lzma-version}} | |
# run: | | |
# # Run autogen.sh script if not already run | |
# if [ ! -f configure ] | |
# then | |
# ./autogen.sh | |
# fi | |
# ./configure --prefix ${{ env.lzma-install }} | |
# make | |
# make check | |
# make install | |
# working-directory: ${{ env.lzma-source }} | |
# CMake-based build | |
- name: Build lzma ${{matrix.lzma-version}} | |
if: env.STEP_ENABLED && steps.cache-lzma.outputs.cache-hit != 'true' | |
run: | | |
mkdir ${HOME}/build-xz | |
cd ${HOME}/build-xz | |
cmake ${{ env.lzma-source }}/CMakeLists.txt -B . --install-prefix ${{ env.lzma-install }} -DBUILD_SHARED_LIBS=ON | |
cmake --build . | |
cmake --install . | |
- name: Show installed lzma files | |
if: env.STEP_ENABLED | |
run: | | |
find . | |
working-directory: ${{ env.lzma-install }} | |
- name: Setup perl | |
if: env.STEP_ENABLED | |
uses: shogo82148/actions-setup-perl@v1 | |
with: | |
perl-version: ${{ matrix.perl }} | |
- name: Perl version | |
if: env.STEP_ENABLED | |
run: perl -V | |
- name: Install dependencies | |
# pod::markdown not available in 5.6 | |
if: env.STEP_ENABLED && matrix.perl != '5.6' | |
run: cpanm --quiet --installdeps --notest . | |
- name: Build | |
if: env.STEP_ENABLED | |
run: | | |
perl Makefile.PL && make | |
- name: Test | |
if: env.STEP_ENABLED | |
run: make test |