diff --git a/.github/workflows/go-test-example.yaml b/.github/workflows/go-test-example.yaml index 9c43c35..410a6da 100644 --- a/.github/workflows/go-test-example.yaml +++ b/.github/workflows/go-test-example.yaml @@ -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() \ No newline at end of file + test_suite: go-test-example + if: always() diff --git a/action.yaml b/action.yaml index 9741235..ee69dcc 100644 --- a/action.yaml +++ b/action.yaml @@ -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' @@ -18,8 +18,8 @@ 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." @@ -27,33 +27,34 @@ inputs: 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[@]}"