Skip to content

Commit e4841fd

Browse files
authored
Merge pull request #14 from DataDog/anmarchenko/releases
[SDTEST-2716] Add release workflows
2 parents 7e5c9e4 + 3ec5351 commit e4841fd

File tree

3 files changed

+59
-8
lines changed

3 files changed

+59
-8
lines changed

.github/workflows/prerelease.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Pre-Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
16+
17+
- name: Set up Go
18+
uses: actions/setup-go@c0137caad775660c0844396c52da96e560aba63d # v5
19+
with:
20+
go-version: '1.25'
21+
22+
- name: Build binaries
23+
run: make release
24+
25+
- name: Create Release and Upload Assets
26+
env:
27+
GH_TOKEN: ${{ github.token }}
28+
run: |
29+
SHORT_SHA=$(git rev-parse --short HEAD)
30+
gh release create "pre-release-$SHORT_SHA" \
31+
--title "Pre-release $SHORT_SHA" \
32+
--prerelease \
33+
dist/*

.github/workflows/release.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: Release
22

33
on:
44
push:
5-
branches: [main]
5+
tags:
6+
- 'v*'
67

78
jobs:
89
release:
@@ -17,7 +18,7 @@ jobs:
1718
- name: Set up Go
1819
uses: actions/setup-go@c0137caad775660c0844396c52da96e560aba63d # v5
1920
with:
20-
go-version: "1.25"
21+
go-version: '1.25'
2122

2223
- name: Build binaries
2324
run: make release
@@ -26,8 +27,19 @@ jobs:
2627
env:
2728
GH_TOKEN: ${{ github.token }}
2829
run: |
29-
SHORT_SHA=$(git rev-parse --short HEAD)
30-
gh release create "pre-release-$SHORT_SHA" \
31-
--title "Pre-release $SHORT_SHA" \
32-
--prerelease \
30+
TAG_NAME=${GITHUB_REF#refs/tags/}
31+
gh release create "$TAG_NAME" \
32+
--title "$TAG_NAME" \
33+
--draft \
34+
--generate-notes \
3335
dist/*
36+
37+
- name: Print Release Summary
38+
env:
39+
GH_TOKEN: ${{ github.token }}
40+
run: |
41+
TAG_NAME=${GITHUB_REF#refs/tags/}
42+
RELEASE_URL=$(gh release view "$TAG_NAME" --json url --jq .url)
43+
echo "## Release Created! 🎉" >> $GITHUB_STEP_SUMMARY
44+
echo "" >> $GITHUB_STEP_SUMMARY
45+
echo "Please review and publish the release! Here is the link: $RELEASE_URL" >> $GITHUB_STEP_SUMMARY

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# DDTest
22

3-
DDTest is a single‑binary CLI that plans and runs your tests in parallel alongside your existing test commands or as a drop‑in runner. It discovers the tests in your repo, fetches Datadog Test Optimization data, configures your CI to use the right number of workers, and distributes test execution across workers.
3+
DDTest is a CLI tool that plans and runs your tests in parallel alongside your existing test commands - or as a drop‑in runner. It discovers the tests in your repo, fetches Datadog Test Optimization data, configures your CI to use the right number of workers, and distributes test execution across workers.
44

55
You need it when Test Impact Analysis shrinks the test workload but CI still launches too many nodes, and skipped tests leave splits wildly uneven. Start by generating a plan (`ddtest plan`) you can feed to any runner, or let DDTest execute the tests for you with `ddtest run` in CI.
66

@@ -19,9 +19,15 @@ cd ddtest && make build
1919

2020
This will create the `ddtest` binary in the current directory. It requires Go 1.24+.
2121

22+
## Prerequisites
23+
24+
Before using DDTest, you must have **Datadog Test Optimization** already set up and enabled with a Datadog Test Optimization library for your language and framework. DDTest relies on this integration to discover your tests and plan test execution accordingly.
25+
26+
For instructions on setting up Test Optimization, see the [Datadog Test Optimization documentation](https://docs.datadoghq.com/tests/setup/).
27+
2228
## Usage
2329

24-
DDTest ships as a single CLI with two primary sub‑commands: `plan` and `run`.
30+
DDTest ships as a CLI tool `ddtest` with two primary sub‑commands: `plan` and `run`.
2531

2632
Use `plan` to discover tests, fetch Datadog Test Optimization data once, and compute a parallelization plan you can reuse on any CI node; use `run` to execute that plan locally or in CI. If a plan is missing, `run` will generate it on the fly.
2733

0 commit comments

Comments
 (0)