name: rake on: push: branches: [ master, main ] pull_request: jobs: rake: name: test on ruby-${{ matrix.ruby }} ${{ matrix.os }} runs-on: ${{ matrix.os }} continue-on-error: ${{ matrix.experimental }} strategy: fail-fast: false matrix: ruby: [ '3.1', '3.0', '2.7' ] os: [ ubuntu-latest, windows-latest, macos-latest ] experimental: [ false ] include: - ruby: 'head' os: 'ubuntu-latest' experimental: true - ruby: 'head' os: 'windows-latest' experimental: true - ruby: 'head' os: 'macos-latest' experimental: true steps: - uses: actions/checkout@v2 with: submodules: recursive - if: matrix.os == 'macos-latest' run: brew install autoconf automake libtool - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - uses: actions/cache@v2 with: path: lib/expressir/express/express_parser.* key: v4-${{ runner.os }}-${{ matrix.ruby }}-${{ hashFiles('ext/express-parser/extconf.rb', 'ext/express-parser/antlrgen/**', 'ext/express-parser/express_parser.cpp', '.git/modules/ext/express-parser/antlr4-upstream/HEAD') }} - if: hashFiles('lib/expressir/express/express_parser.*') == '' run: bundle exec rake compile - run: bundle exec rake # test release workflow pack: runs-on: ubuntu-18.04 strategy: fail-fast: false matrix: host: [ linux, windows, darwin ] steps: - uses: actions/checkout@v2 with: submodules: recursive - uses: ruby/setup-ruby@v1 with: ruby-version: '3.0' # bundler-cache: true important to not use cache because it leads to "cannot find -lrice" # more info https://github.com/lutaml/expressir/runs/2097658383?check_suite_focus=true#step:7:2126 - run: bundle install --jobs 4 --retry 3 # build gem WITHOUT pre-built native extension - run: gem build expressir.gemspec - if: matrix.host == 'linux' uses: actions/upload-artifact@v2 with: name: pkg-ruby path: expressir-*.gem - name: Enable swap run: | sudo fallocate -l 15g /compile.swap sudo chmod 600 /compile.swap sudo mkswap /compile.swap sudo swapon /compile.swap sudo swapon --all --verbose # build gem WITH pre-built native extension - run: bundle exec rake gem:${{ matrix.host }} - uses: actions/upload-artifact@v2 with: name: pkg-${{ matrix.host }} path: pkg/*.gem