Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/actions/compilers/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@ inputs:
description: >-
whitespace separated list of extensions that need be linked statically.

launchable-token:
required: false
description: >-
Launchable token is needed if you want to run Launchable on your forked repository.
See https://github.com/ruby/ruby/wiki/CI-Servers#launchable-ci for details.

launchable-url:
required: false
description: >-
Launchable token is needed if you want to run Launchable on your forked repository.
See https://github.com/ruby/ruby/wiki/CI-Servers#launchable-ci for details.

runs:
using: composite
steps:
Expand All @@ -79,7 +91,7 @@ runs:

- name: Enable Launchable conditionally
id: enable-launchable
run: echo "enable-launchable=false" >> $GITHUB_OUTPUT
run: echo "enable-launchable=true" >> $GITHUB_OUTPUT
shell: bash
if: >-
${{
Expand Down Expand Up @@ -122,4 +134,6 @@ runs:
--env GITHUB_EVENT_NAME
--env GITHUB_SHA
--env GITHUB_HEAD_REF
--env LAUNCHABLE_TOKEN='${{ secrets.LAUNCHABLE_TOKEN }}'
--env LAUNCHABLE_BASE_URL='${{ secrets.LAUNCHABLE_BASE_URL }}'
'ghcr.io/ruby/ruby-ci-image:${{ inputs.tag }}'
102 changes: 75 additions & 27 deletions .github/actions/launchable/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ description: >-
Install the required dependencies and execute the necessary Launchable commands for test recording

inputs:
report-path:
default: launchable_reports.json
required: true
description: The file path of the test report for uploading to Launchable

os:
required: true
description: The operating system that CI runs on. This value is used in Launchable flavor.
Expand All @@ -24,6 +19,12 @@ inputs:
description: >-
Launchable token is needed if you want to run Launchable on your forked repository.
See https://github.com/ruby/ruby/wiki/CI-Servers#launchable-ci for details.

launchable-url:
required: false
description: >-
Launchable token is needed if you want to run Launchable on your forked repository.
See https://github.com/ruby/ruby/wiki/CI-Servers#launchable-ci for details.

builddir:
required: false
Expand All @@ -38,18 +39,21 @@ inputs:
Directory to (re-)checkout source codes. Launchable retrieves the commit information
from the directory.

launchable-workspace:
required: true
default: ${{ github.event.repository.name }}
description: >-
A workspace name in Launchable

test-task:
required: true
required: false
default: ${{ matrix.test_task }}
description: >-
A test task that determine which tests are executed.
Specifies a single test task to be executed.
This value is used in the Launchable flavor.
Either 'test-task' or 'multi-test-tasks' must be configured.

test-tasks:
required: false
default: '[]'
description: >-
Specifies an array of multiple test tasks to be executed.
For example: '["test", "test-all"]'.
If you want to run a single test task, use the 'test-task' input instead.

runs:
using: composite
Expand All @@ -61,11 +65,11 @@ runs:
shell: bash
if: >-
${{
(github.repository == 'ruby/ruby' ||
(github.repository != 'ruby/ruby' && env.LAUNCHABLE_TOKEN)) &&
(inputs.test-task == 'check' ||
inputs.test-task == 'test-all' ||
inputs.test-task == 'test')
(inputs.test-task == 'check'
|| inputs.test-task == 'test-all'
|| inputs.test-task == 'test'
|| contains(fromJSON(inputs.test-tasks), 'test-all')
|| contains(fromJSON(inputs.test-tasks), 'test'))
}}

# Launchable CLI requires Python and Java.
Expand All @@ -83,6 +87,16 @@ runs:
java-version: '17'
if: steps.enable-launchable.outputs.enable-launchable

- name: Check test-task
id: test-task
shell: bash
run: |
test_all_enabled="${{ inputs.test-task == 'check' || inputs.test-task == 'test-all' || contains(fromJSON(inputs.test-tasks), 'test-all') }}"
btest_enabled="${{ inputs.test-task == 'check' || inputs.test-task == 'test' || contains(fromJSON(inputs.test-tasks), 'test') }}"
echo test_all_enabled="${test_all_enabled}" >> $GITHUB_OUTPUT
echo btest_enabled="${btest_enabled}" >> $GITHUB_OUTPUT
if: steps.enable-launchable.outputs.enable-launchable

- name: Set environment variables for Launchable
shell: bash
run: |
Expand All @@ -92,10 +106,11 @@ runs:
: # The following envs are necessary in Launchable tokenless authentication.
: # https://github.com/launchableinc/cli/blob/v1.80.1/launchable/utils/authentication.py#L20
echo "LAUNCHABLE_ORGANIZATION=${{ github.repository_owner }}" >> $GITHUB_ENV
echo "LAUNCHABLE_WORKSPACE=${{ inputs.launchable-workspace }}" >> $GITHUB_ENV
echo "LAUNCHABLE_WORKSPACE=${{ github.event.repository.name }}" >> $GITHUB_ENV
: # https://github.com/launchableinc/cli/blob/v1.80.1/launchable/utils/authentication.py#L71
echo "GITHUB_PR_HEAD_SHA=${{ github.event.pull_request.head.sha || github.sha }}" >> $GITHUB_ENV
echo "LAUNCHABLE_TOKEN=${{ inputs.launchable-token }}" >> $GITHUB_ENV
echo "LAUNCHABLE_BASE_URL=${{ inputs.launchable-url }}" >> $GITHUB_ENV
if: steps.enable-launchable.outputs.enable-launchable

- name: Set up path
Expand All @@ -122,8 +137,16 @@ runs:
: # FIXME: Need to fix `WARNING: Failed to process a change to a file`.
: # https://github.com/launchableinc/cli/issues/786
launchable record build --name ${github_ref}_${GITHUB_PR_HEAD_SHA}
echo "TESTS=${TESTS} --launchable-test-reports=${{ inputs.report-path }}" >> $GITHUB_ENV
if [ "${test_all_enabled}" = "true" ]; then
echo "TESTS=${TESTS} --launchable-test-reports=launchable_test_all.json" >> $GITHUB_ENV
fi
if [ "${btest_enabled}" = "true" ]; then
echo "BTESTS=${BTESTS} --launchable-test-reports=launchable_bootstraptest.json" >> $GITHUB_ENV
fi
if: steps.enable-launchable.outputs.enable-launchable
env:
test_all_enabled: ${{ steps.test-task.outputs.test_all_enabled }}
btest_enabled: ${{ steps.test-task.outputs.btest_enabled }}

- name: Variables to report Launchable
id: variables
Expand All @@ -142,24 +165,49 @@ runs:
# srcdir must be equal to or under workspace
dir=$(echo ${srcdir:+${srcdir}/} | sed 's:[^/][^/]*/:../:g')
fi
report_path="${dir}${builddir:+${builddir}/}${report_path}"
echo report-path="${report_path}" >> $GITHUB_OUTPUT
if [ "${test_all_enabled}" = "true" ]; then
test_report_path="${dir}${builddir:+${builddir}/}launchable_test_all.json"
echo test_report_path="${test_report_path}" >> $GITHUB_OUTPUT
fi
if [ "${btest_enabled}" = "true" ]; then
boot_report_path="${dir}${builddir:+${builddir}/}launchable_bootstraptest.json"
echo boot_report_path="${boot_report_path}" >> $GITHUB_OUTPUT
fi
if: steps.enable-launchable.outputs.enable-launchable
env:
srcdir: ${{ inputs.srcdir }}
builddir: ${{ inputs.builddir }}
report_path: ${{ inputs.report-path }}
test_all_enabled: ${{ steps.test-task.outputs.test_all_enabled }}
btest_enabled: ${{ steps.test-task.outputs.btest_enabled }}

- name: Record test results in Launchable
uses: gacts/run-and-post-run@674528335da98a7afc80915ff2b4b860a0b3553a # v1.4.0
with:
shell: bash
working-directory: ${{ inputs.srcdir }}
post: |
: # record
launchable record tests --flavor os=${{ inputs.os }} --flavor test_task=${{ inputs.test-task }} --flavor test_opts=${test_opts} raw ${report_path}
rm -f ${report_path}
[[ "${test_all_enabled}" = "true" ]] && \
launchable record tests \
--flavor os=${{ inputs.os }} \
--flavor test_task=${{ inputs.test-task }} \
--flavor test_opts=${test_opts} \
--test-suite test-all \
raw ${test_report_path} || true

[[ "${btest_enabled}" = "true" ]] && \
launchable record tests \
--flavor os=${{ inputs.os }} \
--flavor test_task=${{ inputs.test-task }} \
--flavor test_opts=${test_opts} \
--test-suite bootstraptest \
raw ${boot_report_path} || true

rm -f ${test_report_path}
rm -f ${boot_report_path}
if: ${{ always() && steps.enable-launchable.outputs.enable-launchable }}
env:
test_opts: ${{ steps.variables.outputs.test-opts }}
report_path: ${{ steps.variables.outputs.report-path }}
test_report_path: ${{ steps.variables.outputs.test_report_path }}
boot_report_path: ${{ steps.variables.outputs.boot_report_path }}
test_all_enabled: ${{ steps.test-task.outputs.test_all_enabled }}
btest_enabled: ${{ steps.test-task.outputs.btest_enabled }}
112 changes: 0 additions & 112 deletions .github/workflows/annocheck.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/auto_request_review.yml

This file was deleted.

Loading
Loading