Skip to content

Commit

Permalink
ci: tidy up workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
p0deje committed Nov 24, 2023
1 parent 769bc17 commit 4ff27d0
Showing 1 changed file with 40 additions and 45 deletions.
85 changes: 40 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,19 @@ env:
JAVA_OPTS: -Djdk.io.File.enableADS=true

jobs:
ruleset:
name: Ruleset
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: bazel run :buildifier.check
- run: bazel test ...
- if: failure() && runner.debug == '1'
uses: mxschmitt/action-tmate@v3

examples-gem:
name: Examples / Gem (WORKSPACE)
runs-on: ${{ matrix.os }}
name: examples/gem
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
Expand All @@ -25,60 +35,45 @@ jobs:
- jruby-9.4.5.0
- truffleruby-23.1.1
os:
- ubuntu-latest
- macos-latest
- windows-latest
- ubuntu
- macos
- windows
mode:
- bzlmod
- workspace
exclude:
- os: windows-latest
# RubyInstaller doesn't ship previews
- os: windows
ruby: 3.3.0-preview3
- os: windows-latest
# TruffleRuby doesn't work on Windows.
- os: windows
ruby: truffleruby-23.1.1
# https://github.com/p0deje/rules_ruby/issues/23
- mode: bzlmod
ruby: 3.0.6
- mode: bzlmod
ruby: 3.1.4
- mode: bzlmod
ruby: 3.2.2
- mode: bzlmod
ruby: 3.3.0-preview3
- mode: bzlmod
ruby: jruby-9.4.5.0
- mode: bzlmod
ruby: 3.0.6
- mode: bzlmod
ruby: truffleruby-23.1.1
defaults:
run:
working-directory: examples/gem
steps:
- uses: actions/checkout@v4
- uses: p0deje/[email protected]
- run: echo 'RUBY_VERSION = "${{ matrix.ruby }}"' > ruby_version.bzl
- run: bazel test //...
- run: bazel run lib/gem:add-numbers 2
- run: bazel run lib/gem:print-version
- if: failure() && runner.debug == '1'
uses: mxschmitt/action-tmate@v3

# bzlmod is a job rather than a dimension on the matrix above, because it doesn't test different
# interpreters, see https://github.com/p0deje/rules_ruby/issues/23
# (Also, it reduces our CI load by avoiding a new dimension on that matrix)
bzlmod:
name: Examples / Gem (bzlmod)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
defaults:
run:
working-directory: examples/gem
steps:
- uses: actions/checkout@v4
- uses: p0deje/[email protected]
with:
bazelrc: common --enable_bzlmod
- run: bazel test //...
bazelrc: ${{ matrix.mode == 'bzlmod' && 'common --enable_bzlmod' }}
- run: echo 'RUBY_VERSION = "${{ matrix.ruby }}"' > ruby_version.bzl
- run: bazel test ...
- run: bazel run lib/gem:add-numbers 2
- run: bazel run lib/gem:print-version
- if: failure() && runner.debug == '1'
uses: mxschmitt/action-tmate@v3

ruleset:
name: Ruleset
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: bazel run :buildifier.check
- run: bazel test ...
- if: failure() && runner.debug == '1'
uses: mxschmitt/action-tmate@v3

0 comments on commit 4ff27d0

Please sign in to comment.