Skip to content
Open
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
20 changes: 11 additions & 9 deletions .github/workflows/go-test-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,35 @@ on:
branches: [main]

env:
LAUNCHABLE_TOKEN: ${{ secrets.LAUNCHABLE_TOKEN }}
SMART_TESTS_TOKEN: ${{ secrets.LAUNCHABLE_TOKEN }}

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: 1.18
go-version: "1.21"
- name: Clone go-test example
run: git clone https://github.com/launchableinc/examples.git
- name: Install dependencies
run: go install github.com/jstemmer/go-junit-report@latest
run: go install github.com/jstemmer/go-junit-report/v2@latest
- name: Record build action
uses: ./
# uses: launchableinc/record-build-action@v1.0.0
with:
build_name: $GITHUB_RUN_ID
source_path: ./examples/go/
- name: test
run: cd examples/go && go test -v ./... 2>&1 | go-junit-report -set-exit-code > report.xml
- name: Record test results to build action
uses: launchableinc/record-test-results-to-build-action@v1.0.0
- name: Record test results
uses: cloudbees-oss/record-test-results-to-build-action@main
with:
build_name: $GITHUB_RUN_ID
report_path: ./examples/go/
test_runner: go-test
if: always()
test_suite: go-test-example
if: always()
47 changes: 24 additions & 23 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "Record build action"
author: "launchableinc"
description: "Launchable action for recording a build"
author: "CloudBees"
description: "Smart Tests action for recording a build"
branding:
icon: 'circle'
color: 'gray-dark'
Expand All @@ -18,42 +18,43 @@ inputs:
default: "false"
python_version:
required: false
description: "Python version >= 3.5 <=3.10. Default 3.10"
default: "3.10"
description: "Python version >= 3.13. Default 3.13"
default: "3.13"
source_path:
required: false
description: "Path to a local Git repository/workspace. Default current directory."
default: "."
runs:
using: "composite"
steps:
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ inputs.python_version }}
- name: Set up JDK 1.8
uses: actions/setup-java@v1
uses: actions/setup-java@v5
with:
java-version: 1.8
distribution: 'temurin'
java-version: 8
- name: Install uv
uses: astral-sh/setup-uv@v5
- id: set_caller
shell: bash
run: echo "SMART_TESTS_CALLER=record-build-action" >> $GITHUB_ENV
- id: install
shell: bash
run: pip install launchable
run: uv tool install smart-tests-cli --python ${{ inputs.python_version }}
- id: verify
shell: bash
run: |
launchable verify
smart-tests verify
- id: record_build
shell: bash
run: |
if [ "${{ inputs.no_submodules }}" == "false" ]; then
launchable record build \
--name ${{ inputs.build_name }} \
--max-days ${{ inputs.max_days }} \
--source src=${{ inputs.source_path }}
else
launchable record build \
--name ${{ inputs.build_name }} \
--max-days ${{ inputs.max_days }} \
--source src=${{ inputs.source_path }} \
--no-submodules
options=(
"--build" "${{ inputs.build_name }}"
"--max-days" "${{ inputs.max_days }}"
"--source" "src=${{ inputs.source_path }}"
)

if [ "${{ inputs.no_submodules }}" == "true" ]; then
options+=("--no-submodules")
fi

smart-tests record build "${options[@]}"
Loading