
name: pmemkv-other
on:
  schedule:
    # run this job at 01:00 UTC everyday
    - cron:  '0 1 * * *'

env:
  REPO:           pmemkv
  GITHUB_REPO:    pmem/pmemkv
  CONTAINER_REG:  ghcr.io/pmem/pmemkv
  HOST_WORKDIR:   ${{ github.workspace }}
  WORKDIR:        utils/docker
  IMG_VER:        latest
  TYPE:           debug
  PUSH_IMAGE:     1
  # use org's Private Access Token to log in to GitHub Container Registry
  CONTAINER_REG_USER:   ${{ secrets.GH_CR_USER }}
  CONTAINER_REG_PASS:   ${{ secrets.GH_CR_PAT }}

jobs:
  linux:
    name: Linux-other
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        CONFIG: ["OS=centos OS_VER=8",
                 "OS=archlinux-base OS_VER=latest",
                 "OS=debian OS_VER=testing",
                 "OS=debian OS_VER=unstable",
                 "OS=fedora OS_VER=33",
                 "OS=fedora OS_VER=rawhide PUSH_IMAGE=0",
                 "TYPE=building OS=fedora OS_VER=rawhide",
                 "OS=opensuse-leap OS_VER=latest",
                 "OS=opensuse-tumbleweed OS_VER=latest",
                 "OS=ubuntu OS_VER=18.04",
                 "OS=ubuntu OS_VER=rolling PUSH_IMAGE=0",
                 "TYPE=building OS=ubuntu OS_VER=rolling"]
    steps:
      - name: Clone the git repo
        uses: actions/checkout@v2

      # other_OSes workflow rebuilds images every time and push them to the container registry
      - name: Rebuild and push the image
        run: cd $WORKDIR && ${{ matrix.CONFIG }} ./pull-or-rebuild-image.sh rebuild

      - name: Run the build
        run: cd $WORKDIR && ${{ matrix.CONFIG }} ./build.sh
