name: truffle
concurrency:
  group: "${{github.workflow}}-${{github.ref}}"
  cancel-in-progress: true
on:
  workflow_dispatch:
  schedule:
    - cron: "0 8 * * 1,3,5" # At 08:00 on Monday, Wednesday, and Friday # https://crontab.guru/#0_8_*_*_1,3,5

jobs:
  truffleruby-head:
    strategy:
      fail-fast: false
      matrix:
        flags:
          - "--disable-system-libraries --disable-static"
          - "--disable-system-libraries --enable-static"
          - "--enable-system-libraries"
    continue-on-error: true
    runs-on: ubuntu-latest
    container:
      image: ghcr.io/sparklemotion/nokogiri-test:truffle-nightly
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true
      - uses: actions/cache@v2
        with:
          path: ports/archives
          key: tarballs-ubuntu-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
      - run: bundle install --local || bundle install
      - run: bundle exec rake compile -- ${{matrix.flags}}
      - run: bundle exec rake test
