name: run units target on AlpineLinux

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  testing:
    strategy:
      fail-fast: false
      matrix:
        tag: ['3.15','3.14','3.12','3.13']

    runs-on: ubuntu-20.04

    container: alpine:${{ matrix.tag }}

    steps:
      - run: apk add libc-dev gcc make automake autoconf pkgconf python3 file diffutils git

      # this is to fix https://github.com/actions/checkout/issues/760
      - run: git config --global --add safe.directory /__w/ctags/ctags

      - uses: actions/checkout@v2

      - run: cc --version

      - run: ./autogen.sh
      - run: ./configure --prefix=/usr
      - run: make
      - run: make install
      - run: file /usr/bin/ctags
      - run: ctags --version
      - run: make check V=1
      - run: make roundtrip
