Skip to content

Commit 5dfdd25

Browse files
authored
Merge branch 'master' into support-xdg-dirs
2 parents 55f6624 + bd9a813 commit 5dfdd25

40 files changed

+842
-331
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Set up Launchable
2+
description: >-
3+
Install the required dependencies and execute the necessary Launchable commands for test recording
4+
5+
inputs:
6+
report-path:
7+
default: launchable_reports.json
8+
required: true
9+
description: The file path of the test report for uploading to Launchable
10+
11+
test-task:
12+
default: none
13+
required: true
14+
description: >-
15+
Test task that determine how tests are run.
16+
This value is used in the Launchable flavor.
17+
18+
runs:
19+
using: composite
20+
21+
steps:
22+
- name: Enable Launchable conditionally
23+
id: enable-launchable
24+
run: echo "enable-launchable=true" >> $GITHUB_OUTPUT
25+
shell: bash
26+
if: ${{ github.repository == 'ruby/debug' }}
27+
28+
# Launchable CLI requires Python and Java.
29+
# https://www.launchableinc.com/docs/resources/cli-reference/
30+
- name: Set up Python
31+
uses: actions/setup-python@871daa956ca9ea99f3c3e30acb424b7960676734 # v5.0.0
32+
with:
33+
python-version: "3.x"
34+
if: ${{ steps.enable-launchable.outputs.enable-launchable }}
35+
36+
- name: Set up Java
37+
uses: actions/setup-java@7a445ee88d4e23b52c33fdc7601e40278616c7f8 # v4.0.0
38+
with:
39+
distribution: 'temurin'
40+
java-version: '17'
41+
if: ${{ steps.enable-launchable.outputs.enable-launchable }}
42+
43+
- name: Set environment variables for Launchable
44+
shell: bash
45+
run: |
46+
: # GITHUB_PULL_REQUEST_URL are used for commenting test reports in Launchable Github App.
47+
: # https://github.com/launchableinc/cli/blob/v1.80.1/launchable/utils/link.py#L42
48+
echo "GITHUB_PULL_REQUEST_URL=${{ github.event.pull_request.html_url }}" >> $GITHUB_ENV
49+
: # The following envs are necessary in Launchable tokenless authentication.
50+
: # https://github.com/launchableinc/cli/blob/v1.80.1/launchable/utils/authentication.py#L20
51+
echo "LAUNCHABLE_ORGANIZATION=${{ github.repository_owner }}" >> $GITHUB_ENV
52+
echo "LAUNCHABLE_WORKSPACE=${{ github.event.repository.name }}" >> $GITHUB_ENV
53+
: # https://github.com/launchableinc/cli/blob/v1.80.1/launchable/utils/authentication.py#L71
54+
echo "GITHUB_PR_HEAD_SHA=${{ github.event.pull_request.head.sha || github.sha }}" >> $GITHUB_ENV
55+
if: ${{ steps.enable-launchable.outputs.enable-launchable }}
56+
57+
- name: Set up Launchable
58+
shell: bash
59+
run: |
60+
set -x
61+
PATH=$PATH:$(python -msite --user-base)/bin
62+
echo "PATH=$PATH" >> $GITHUB_ENV
63+
pip install --user launchable
64+
launchable verify
65+
: # The build name cannot include a slash, so we replace the string here.
66+
github_ref="${{ github.ref }}"
67+
github_ref="${github_ref//\//_}"
68+
launchable record build --name ${github_ref}_${GITHUB_PR_HEAD_SHA}
69+
echo "TESTOPTS=${TESTOPTS} --runner=launchable --launchable-test-report-json=${{ inputs.report-path }}" >> $GITHUB_ENV
70+
if: ${{ steps.enable-launchable.outputs.enable-launchable }}
71+
72+
- name: Record test results in Launchable
73+
uses: gacts/run-and-post-run@674528335da98a7afc80915ff2b4b860a0b3553a # v1.4.0
74+
with:
75+
shell: bash
76+
post: |
77+
launchable record tests --flavor os=${{ inputs.os }} --flavor test_task=${{ inputs.test-task }} raw ${{ inputs.report-path }}
78+
rm -f ${{ inputs.report-path }}
79+
if: ${{ always() && steps.enable-launchable.outputs.enable-launchable }}

.github/workflows/protocol.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,40 @@ on:
77
branches: [ master ]
88

99
jobs:
10-
test:
10+
ruby-versions:
11+
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
12+
with:
13+
engine: cruby
14+
min_version: 2.7
15+
versions: '["debug"]'
1116

17+
test:
18+
needs: ruby-versions
1219
runs-on: ubuntu-latest
1320
timeout-minutes: 10
1421
strategy:
1522
fail-fast: false
1623
matrix:
17-
ruby-version: ["2.7", "3.0", "3.1", "3.2", "head", "debug"]
24+
ruby-version: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
1825

1926
steps:
2027
- uses: actions/checkout@v4
28+
with:
29+
# Set fetch-depth: 10 so that Launchable can receive commits information.
30+
fetch-depth: 10
31+
- name: Set up Launchable
32+
uses: ./.github/actions/launchable/setup
33+
with:
34+
os: ubuntu-latest
35+
test-task: test_protocol
2136
- name: Set up Ruby
2237
uses: ruby/setup-ruby@v1
2338
with:
2439
ruby-version: ${{ matrix.ruby-version }}
2540
bundler-cache: true
26-
- name: Run tests
41+
- name: Set up tests
2742
run: |
2843
bundle exec rake clobber
2944
bundle exec rake compile
30-
bundle exec rake test_protocol
45+
- name: Run tests
46+
run: bundle exec rake test_protocol

.github/workflows/ruby-macos.yaml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,39 @@ on:
77
branches: [ master ]
88

99
jobs:
10-
test:
10+
ruby-versions:
11+
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
12+
with:
13+
engine: cruby
14+
min_version: 3.2
1115

16+
test:
17+
needs: ruby-versions
1218
runs-on: macos-latest
1319
timeout-minutes: 15
1420
strategy:
1521
fail-fast: false
1622
matrix:
17-
ruby-version: ['3.2', 'head']
23+
ruby-version: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
1824

1925
steps:
2026
- uses: actions/checkout@v4
27+
with:
28+
# Set fetch-depth: 10 so that Launchable can receive commits information.
29+
fetch-depth: 10
30+
- name: Set up Launchable
31+
uses: ./.github/actions/launchable/setup
32+
with:
33+
os: macos-latest
34+
test-task: test_console
2135
- name: Set up Ruby
2236
uses: ruby/setup-ruby@v1
2337
with:
2438
ruby-version: ${{ matrix.ruby-version }}
2539
bundler-cache: true
26-
- name: Run tests
40+
- name: Set up tests
2741
run: |
2842
bundle exec rake clobber
2943
bundle exec rake compile
30-
bundle exec rake test_console
44+
- name: Run tests
45+
run: bundle exec rake test_console

.github/workflows/ruby.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,40 @@ on:
77
branches: [ master ]
88

99
jobs:
10-
test:
10+
ruby-versions:
11+
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
12+
with:
13+
engine: cruby
14+
min_version: 2.7
15+
versions: '["debug"]'
1116

17+
test:
18+
needs: ruby-versions
1219
runs-on: ubuntu-latest
1320
timeout-minutes: 30
1421
strategy:
1522
fail-fast: false
1623
matrix:
17-
ruby-version: ["2.7", "3.0", "3.1", "3.2", "head", "debug"]
24+
ruby-version: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
1825

1926
steps:
2027
- uses: actions/checkout@v4
28+
with:
29+
# Set fetch-depth: 10 so that Launchable can receive commits information.
30+
fetch-depth: 10
31+
- name: Set up Launchable
32+
uses: ./.github/actions/launchable/setup
33+
with:
34+
os: ubuntu-latest
35+
test-task: test_console
2136
- name: Set up Ruby
2237
uses: ruby/setup-ruby@v1
2338
with:
2439
ruby-version: ${{ matrix.ruby-version }}
2540
bundler-cache: true
26-
- name: Run tests
41+
- name: Set up tests
2742
run: |
2843
bundle exec rake clobber
2944
bundle exec rake compile
30-
bundle exec rake test_console
45+
- name: Run tests
46+
run: bundle exec rake test_console

.github/workflows/test_test.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,40 @@ on:
77
branches: [ master ]
88

99
jobs:
10-
test:
10+
ruby-versions:
11+
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
12+
with:
13+
engine: cruby
14+
min_version: 3.0
15+
versions: '["debug"]'
1116

17+
test:
18+
needs: ruby-versions
1219
runs-on: ubuntu-latest
1320
timeout-minutes: 30
1421
strategy:
1522
fail-fast: false
1623
matrix:
17-
ruby-version: ['3.0', '3.1', '3.2', 'head', 'debug']
24+
ruby-version: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
1825

1926
steps:
2027
- uses: actions/checkout@v4
28+
with:
29+
# Set fetch-depth: 10 so that Launchable can receive commits information.
30+
fetch-depth: 10
31+
- name: Set up Launchable
32+
uses: ./.github/actions/launchable/setup
33+
with:
34+
os: ubuntu-latest
35+
test-task: test_test
2136
- name: Set up Ruby
2237
uses: ruby/setup-ruby@v1
2338
with:
2439
ruby-version: ${{ matrix.ruby-version }}
2540
bundler-cache: true
26-
- name: Run tests
41+
- name: Set up tests
2742
run: |
2843
bundle exec rake clobber
2944
bundle exec rake compile
30-
bundle exec rake test_test
45+
- name: Run tests
46+
run: bundle exec rake test_test

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ gem "rake-compiler"
77
gem "test-unit", "~> 3.0"
88
gem "test-unit-rr"
99
gem "json-schema"
10+
gem "test-unit-launchable"

0 commit comments

Comments
 (0)