Multiple job run in single job script

I’m using arch-travis to build some of my ArchLinux packages using docker in Travis. Lately (26 Sep) I’ve noticed that, despite there is no env matrix in my .travis.yml all my build have 5 jobs instead of one.

My .travis.yml

sudo: required

  - /.*/

  - ~/.ccache
  - ~/.pkg-cache
  - blender-addons-contrib.git
  - blender-addons.git
  - blender-dev-tools.git
  - blender-translations.git
  - blender

- docker

  - ~/.ccache:~/.ccache
  - ~/.pkg-cache:/var/cache/pacman/pkg
# - bartus=
  - ccache
  - ccache-ext
# cuda need to be installed before `makepkg` invocation in order to allow nvcc-ccache logic to work.
  - cuda
  - moreutils
  - oidn
# 1.Override `package-cleanup.hook` to preserve cache for travis.
# 2.Enable ccache
# 3.Multithreaded build and compress
# 4.Suppress all gcc warnings
  - |
     sudo mkdir /etc/pacman.d/hooks/
     sudo ln -s /dev/null /etc/pacman.d/hooks/package-cleanup.hook
     sudo sed -i '/^BUILDENV/s/\!ccache/ccache/' /etc/makepkg.conf
     sudo sed -i '/#MAKEFLAGS=/c MAKEFLAGS="-j2"' /etc/makepkg.conf
     sudo sed -i '/^COMPRESSXZ/s/\xz/xz -T 2/' /etc/makepkg.conf
     sudo sed -i '$a   CFLAGS="$CFLAGS -w"'   /etc/makepkg.conf
     sudo sed -i '$a CXXFLAGS="$CXXFLAGS -w"' /etc/makepkg.conf
# Normalize TRAVIS variable
  - |
     [ "$TRAVIS" == "true" ] && TRAVIS=1 || TRAVIS=0
# Build
  - 'echo "Travis initialization time:      $travis_uptime"'
  - "arch_uptime=$(cut -d' ' -f1 /proc/uptime|cut -d'.' -f1)"
  - 'echo "Arch-Travis initialization time: $((arch_uptime-travis_uptime)) seconds"'
  - ccache -s
  - ccache -z
# set timeout to 50m minus current uptime, minus travis cache in time, minus 60 second buffer for arch-travis cleanup.
  - timeout $((50*60-arch_uptime-travis_uptime-60)) makepkg -s --noconfirm > >(ts -s '%.T'); _makepkg_return=$?
  - sudo pacman -Sc --noconfirm
  - ccache -s
  - ccache -z
  - exit $_makepkg_return
- "export travis_uptime=$(cut -d' ' -f1 /proc/uptime|cut -d'.' -f1)"
- 'echo "Travis initialization time: $travis_uptime seconds"'
# assume caching out will take the same amount of time as caching in those making build time equal to 50 minutes minus two time current uptime.
- "curl -s| timeout $((50*60-2*travis_uptime)) bash"
- "echo pacman pkg cache size: $(du -h ~/.pkg-cache|cut -f1) in $(ls ~/.pkg-cache|wc -l) files"

#  on:
#    branch: master
#  skip_cleanup: true
#  provider: script
#  script: bash

I’ve tried resetting build, but result is the same.
Have anyone encounter similar issue, should i report it?

The issue here is that you are using a reserved key arch to do something else. It is one of the axes along which we perform matrix expansion. (This is unfortunately not clearly documented.) Since there are 5 keys in arch, you get 5 jobs.

I think it is best for the tool to use another key, e.g., _arch instead.

Thank you kindly :blush: you’ve saved me a lot of nerwes !