Skip to content

Commit 931a5f6

Browse files
committed
add a small internal-test binary
1 parent 8f78845 commit 931a5f6

File tree

6 files changed

+143
-0
lines changed

6 files changed

+143
-0
lines changed

.config/hakari.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ platforms = [
2424
exact-versions = true
2525

2626
[traversal-excludes]
27+
workspace-members = ["internal-test"]
2728
# This is not part of the default build and is rarely needed.
2829
third-party = [{ name = "console-subscriber" }]

.github/workflows/release-test.yml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# adapted from https://github.com/taiki-e/cargo-hack/blob/main/.github/workflows/release.yml
2+
3+
name: Publish test releases to GitHub
4+
on:
5+
push:
6+
tags:
7+
- "*"
8+
9+
jobs:
10+
internal-test-release:
11+
if: github.repository_owner == 'nextest-rs' && startsWith(github.ref_name, 'internal-test-')
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
15+
with:
16+
persist-credentials: false
17+
# Note: do not publish this until binaries are built and uploaded below. This is so that
18+
# `cargo binstall` keeps working.
19+
- uses: taiki-e/create-gh-release-action@26b80501670402f1999aff4b934e1574ef2d3705 # v1
20+
id: create-gh-release
21+
with:
22+
prefix: internal-test
23+
title: $prefix $version
24+
branch: main
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
outputs:
28+
version: ${{ steps.create-gh-release.outputs.version }}
29+
30+
build-cargo-nextest-binaries:
31+
name: Build cargo-nextest binaries for ${{ matrix.target }}
32+
if: github.repository_owner == 'nextest-rs' && startsWith(github.ref_name, 'cargo-nextest-')
33+
needs:
34+
- internal-test-release
35+
strategy:
36+
matrix:
37+
include:
38+
# Native builds
39+
- target: x86_64-pc-windows-msvc
40+
os: windows-latest
41+
build-target: x86_64-pc-windows-msvc
42+
build-tool: cargo
43+
dry-run: true
44+
- target: i686-pc-windows-msvc
45+
os: windows-latest
46+
build-target: i686-pc-windows-msvc
47+
build-tool: cargo
48+
dry-run: true
49+
- target: aarch64-pc-windows-msvc
50+
os: windows-latest
51+
build-target: aarch64-pc-windows-msvc
52+
build-tool: cargo
53+
dry-run: true
54+
runs-on: ${{ matrix.os }}
55+
steps:
56+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
57+
- name: Install Rust
58+
uses: dtolnay/rust-toolchain@stable
59+
- uses: taiki-e/upload-rust-binary-action@db101489b509ad1c7acce163e118eb36a1650f98 # v1.26.0
60+
with:
61+
bin: internal-test
62+
# The tag name contains the binary name so just use that.
63+
archive: $tag-$target
64+
build-tool: ${{ matrix.build-tool }}
65+
target: ${{ matrix.build-target }}
66+
tar: all
67+
zip: windows
68+
checksum: b2,sha256
69+
# dry-run to not upload the binary to the GitHub release
70+
dry-run: ${{ matrix.dry-run }}
71+
dry-run-intended: ${{ matrix.dry-run }}
72+
env:
73+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
CARGO_PROFILE_RELEASE_LTO: true
75+
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1
76+
- name: Upload unsigned Windows artifact
77+
id: upload-unsigned-artifact
78+
if: endsWith(matrix.target, '-pc-windows-msvc')
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: ${{ matrix.target }}-unsigned
82+
path: target/${{ matrix.build-target }}/release/internal-test.exe
83+
- run: mkdir -p target/signed
84+
- name: Submit signing request
85+
id: submit-signing-request
86+
if: endsWith(matrix.target, '-pc-windows-msvc')
87+
uses: signpath/github-action-submit-signing-request@v1.1
88+
with:
89+
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
90+
organization-id: '34634019-2ee0-4162-830a-72cd1a0cb73f'
91+
project-slug: 'nextest'
92+
signing-policy-slug: 'internal-test'
93+
github-artifact-id: '${{ steps.upload-unsigned-artifact.outputs.artifact-id }}'
94+
wait-for-completion: true
95+
output-artifact-directory: 'target/signed'
96+
- name: Archive and upload Windows artifacts
97+
id: archive-windows-artifact
98+
if: endsWith(matrix.target, '-pc-windows-msvc')
99+
shell: bash
100+
run: |
101+
cd target/signed
102+
unzip ${{ matrix.target }}-unsigned.zip
103+
tar -czf ${{ github.ref_name }}-${{ matrix.target }}.tar.gz internal-test.exe
104+
mv ${{ matrix.target }}-unsigned.zip ${{ github.ref_name }}-${{ matrix.target }}.zip
105+
gh release upload ${{ github.ref }} \
106+
${{ github.ref_name }}-${{ matrix.target }}.tar.gz \
107+
${{ github.ref_name }}-${{ matrix.target }}.zip
108+
- name: Set archive output variable
109+
id: archive-output
110+
shell: bash
111+
run: |
112+
if [[ ${{ matrix.target }} == *-pc-windows-msvc ]]; then
113+
echo "${{ matrix.target }}-tar=${{ github.ref_name }}-${{ matrix.target }}".tar.gz >> $GITHUB_OUTPUT
114+
echo "${{ matrix.target }}-zip=${{ github.ref_name }}-${{ matrix.target }}".zip >> $GITHUB_OUTPUT
115+
else
116+
echo "${{ matrix.target }}-tar=${{ github.ref_name }}-${{ matrix.target }}".tar.gz >> $GITHUB_OUTPUT
117+
fi
118+
outputs:
119+
x86_64-windows-tar: ${{ steps.archive-output.outputs.x86_64-pc-windows-msvc-tar }}
120+
x86_64-windows-zip: ${{ steps.archive-output.outputs.x86_64-pc-windows-msvc-zip }}
121+
i686-windows-tar: ${{ steps.archive-output.outputs.i686-pc-windows-msvc-tar }}
122+
i686-windows-zip: ${{ steps.archive-output.outputs.i686-pc-windows-msvc-zip }}
123+
aarch64-windows-tar: ${{ steps.archive-output.outputs.aarch64-pc-windows-msvc-tar }}
124+
aarch64-windows-zip: ${{ steps.archive-output.outputs.aarch64-pc-windows-msvc-zip }}

Cargo.lock

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ members = [
77
"nextest-filtering",
88
"nextest-metadata",
99
"nextest-runner",
10+
"internal-test",
1011
"workspace-hack",
1112
]
1213

internal-test/Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "internal-test"
3+
version = "0.1.0"
4+
rust-version.workspace = true
5+
edition.workspace = true
6+
license.workspace = true
7+
8+
[dependencies]

internal-test/src/main.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Copyright (c) The nextest Contributors
2+
// SPDX-License-Identifier: MIT OR Apache-2.0
3+
4+
/// A small test program for testing nextest's CI/CD processes.
5+
fn main() {}

0 commit comments

Comments
 (0)