test #808
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '25 10 * * *' | |
workflow_dispatch: | |
jobs: | |
ruby-versions: | |
if: ${{ startsWith(github.repository, 'ruby/') || github.event_name != 'schedule' }} | |
uses: ruby/actions/.github/workflows/ruby_versions.yml@master | |
with: | |
engine: cruby | |
test: | |
needs: ruby-versions | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }} | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
include: | |
- ruby: jruby | |
- ruby: jruby-head | |
- ruby: truffleruby | |
- ruby: truffleruby-head | |
runs-on: ${{ matrix.os || 'ubuntu-latest' }} | |
steps: | |
- name: git config | |
run: | | |
git config --global core.autocrlf false | |
git config --global core.eol lf | |
git config --global advice.detachedHead 0 | |
- uses: actions/checkout@v4 | |
- name: Set up Ruby ${{ matrix.ruby }} | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
rubygems: latest | |
- name: Experiment with a manual bundle install | |
run: bundle install | |
- name: Run test | |
run: rake # Attempting without 'bundle exec' | |
- name: Select the latest ruby release | |
id: latest | |
run: | | |
printenv versions | jq -r '[.[] | select(test("^[0-9]"))] | "version="+max' >> $GITHUB_OUTPUT | |
env: | |
versions: ${{needs.ruby-versions.outputs.versions}} | |
shell: sh | |
- id: build | |
run: | | |
rake build | |
echo "pkg=${GITHUB_REPOSITORY#*/}-${RUNNING_OS%-*}" >> $GITHUB_OUTPUT | |
env: | |
RUNNING_OS: ${{matrix.os}} | |
if: ${{matrix.ruby == steps.latest.outputs.version}} | |
shell: bash | |
- name: Upload package | |
uses: actions/upload-artifact@v3 | |
with: | |
path: pkg/*.gem | |
name: ${{steps.build.outputs.pkg}} | |
if: steps.build.outputs.pkg |