Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 159432f

Browse files
committed
dev(trdl-actions): e2e-test install action
Signed-off-by: Alexandr Zaytsev <[email protected]>
1 parent 171bed0 commit 159432f

File tree

11 files changed

+72
-32
lines changed

11 files changed

+72
-32
lines changed

.github/workflows/_lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Lint
33
on: [push]
44

55
jobs:
6-
_:
6+
lint:
77
runs-on: ubuntu-22.04
88
timeout-minutes: 10
99

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Test e2e Install
2+
3+
on: [push]
4+
5+
jobs:
6+
test-e2e-install:
7+
runs-on: ubuntu-22.04
8+
timeout-minutes: 10
9+
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
14+
- name: Install trdl
15+
uses: ./install
16+
17+
- name: Use trdl binary
18+
run: |
19+
which trdl
20+
ls -l $(which trdl)
21+
trdl version
22+
trdl --help

.github/workflows/_test_unit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Test Unit
33
on: [push]
44

55
jobs:
6-
_:
6+
test-unit:
77
runs-on: ubuntu-22.04
88
timeout-minutes: 10
99

install/dist/index.mjs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29826,8 +29826,8 @@ async function execOutput(commandLine, args, options) {
2982629826
const stderr = [];
2982729827
const defaultOptions = {
2982829828
// https://github.com/actions/toolkit/blob/%40actions/exec%401.0.1/packages/exec/src/interfaces.ts#L39
29829-
silent: true,
29830-
failOnStdErr: true,
29829+
silent: false,
29830+
failOnStdErr: false,
2983129831
listeners: {
2983229832
stdline(data) {
2983329833
stdout.push(data);
@@ -30007,18 +30007,19 @@ async function installTrdl(toolName, toolVersion, binPath) {
3000730007
coreExports.addPath(installedPath);
3000830008
}
3000930009
async function Run() {
30010+
coreExports.setCommandEcho(coreExports.isDebug());
3001030011
const trdlCli = new TrdlCli();
3001130012
const gpgCli = new GpgCli();
3001230013
const inputs = parseInputs();
3001330014
await Do(trdlCli, gpgCli, inputs);
3001430015
}
3001530016
async function Do(trdlCli, gpgCli, inputs) {
3001630017
coreExports.startGroup('Install or self-update trdl.');
30017-
coreExports.debug(format(`parsed inputs=%o`, inputs));
30018+
coreExports.info(format(`parsed inputs=%o`, inputs));
3001830019
const defaults = trdlCli.defaults();
30019-
coreExports.debug(format(`trdl defaults=%o`, defaults));
30020+
coreExports.info(format(`trdl defaults=%o`, defaults));
3002030021
const options = await getOptions(inputs, defaults);
30021-
coreExports.debug(format(`installation options=%o`, options));
30022+
coreExports.info(format(`installation options=%o`, options));
3002230023
const toolCache = findTrdlCache(defaults.repo, options.version);
3002330024
if (toolCache) {
3002430025
coreExports.info(`Installation skipped. trdl@v${options.version} is found at path ${toolCache}.`);
@@ -30030,11 +30031,14 @@ async function Do(trdlCli, gpgCli, inputs) {
3003030031
}
3003130032
await gpgCli.mustGnuGP();
3003230033
const [binUrl, sigUrl, ascUrl] = formatDownloadUrls(options.version);
30033-
coreExports.debug(format('%s bin_url=%s', defaults.repo, binUrl));
30034-
coreExports.debug(format('%s sig_url=%s', defaults.repo, sigUrl));
30035-
coreExports.debug(format('%s asc_url=%s', defaults.repo, ascUrl));
30036-
coreExports.info('Downloading signatures.');
30034+
coreExports.info(format('%s binUrl=%s', defaults.repo, binUrl));
30035+
coreExports.info(format('%s sigUrl=%s', defaults.repo, sigUrl));
30036+
coreExports.info(format('%s ascUrl=%s', defaults.repo, ascUrl));
30037+
coreExports.info('Downloading binary and signatures.');
3003730038
const [binPath, sigPath, ascPath] = await downloadParallel(binUrl, sigUrl, ascUrl);
30039+
coreExports.debug(format('%s binPath=%s', defaults.repo, binPath));
30040+
coreExports.debug(format('%s sigPath=%s', defaults.repo, sigPath));
30041+
coreExports.debug(format('%s ascPath=%s', defaults.repo, ascPath));
3003830042
coreExports.info('Importing and verifying gpg keys.');
3003930043
await gpgCli.import(ascPath);
3004030044
await gpgCli.verify(sigPath, binPath);

install/dist/index.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

install/src/action.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getInput, platform, addPath, info, startGroup, endGroup, debug } from '@actions/core'
1+
import {getInput, platform, addPath, info, startGroup, endGroup, setCommandEcho, isDebug, debug} from '@actions/core'
22
import { HttpClient } from '@actions/http-client'
33
import { downloadTool, find, cacheFile } from '@actions/tool-cache'
44
import { chmodSync } from 'node:fs'
@@ -100,6 +100,8 @@ async function installTrdl(toolName: string, toolVersion: string, binPath: strin
100100
}
101101

102102
export async function Run(): Promise<void> {
103+
setCommandEcho(isDebug())
104+
103105
const trdlCli = new TrdlCli()
104106
const gpgCli = new GpgCli()
105107
const inputs = parseInputs()
@@ -109,13 +111,13 @@ export async function Run(): Promise<void> {
109111

110112
export async function Do(trdlCli: TrdlCli, gpgCli: GpgCli, inputs: inputs): Promise<void> {
111113
startGroup('Install or self-update trdl.')
112-
debug(format(`parsed inputs=%o`, inputs))
114+
info(format(`parsed inputs=%o`, inputs))
113115

114116
const defaults = trdlCli.defaults()
115-
debug(format(`trdl defaults=%o`, defaults))
117+
info(format(`trdl defaults=%o`, defaults))
116118

117119
const options = await getOptions(inputs, defaults)
118-
debug(format(`installation options=%o`, options))
120+
info(format(`installation options=%o`, options))
119121

120122
const toolCache = findTrdlCache(defaults.repo, options.version)
121123

@@ -133,12 +135,15 @@ export async function Do(trdlCli: TrdlCli, gpgCli: GpgCli, inputs: inputs): Prom
133135
await gpgCli.mustGnuGP()
134136

135137
const [binUrl, sigUrl, ascUrl] = formatDownloadUrls(options.version)
136-
debug(format('%s bin_url=%s', defaults.repo, binUrl))
137-
debug(format('%s sig_url=%s', defaults.repo, sigUrl))
138-
debug(format('%s asc_url=%s', defaults.repo, ascUrl))
138+
info(format('%s binUrl=%s', defaults.repo, binUrl))
139+
info(format('%s sigUrl=%s', defaults.repo, sigUrl))
140+
info(format('%s ascUrl=%s', defaults.repo, ascUrl))
139141

140-
info('Downloading signatures.')
142+
info('Downloading binary and signatures.')
141143
const [binPath, sigPath, ascPath] = await downloadParallel(binUrl, sigUrl, ascUrl)
144+
debug(format('%s binPath=%s', defaults.repo, binPath))
145+
debug(format('%s sigPath=%s', defaults.repo, sigPath))
146+
debug(format('%s ascPath=%s', defaults.repo, ascPath))
142147

143148
info('Importing and verifying gpg keys.')
144149
await gpgCli.import(ascPath)

lib/exec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export async function execOutput(
1616

1717
const defaultOptions = {
1818
// https://github.com/actions/toolkit/blob/%40actions/exec%401.0.1/packages/exec/src/interfaces.ts#L39
19-
silent: true,
20-
failOnStdErr: true,
19+
silent: false,
20+
failOnStdErr: false,
2121
listeners: {
2222
stdline(data: string) {
2323
stdout.push(data)

setup-app/dist/index.mjs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27317,8 +27317,8 @@ async function execOutput(commandLine, args, options) {
2731727317
const stderr = [];
2731827318
const defaultOptions = {
2731927319
// https://github.com/actions/toolkit/blob/%40actions/exec%401.0.1/packages/exec/src/interfaces.ts#L39
27320-
silent: true,
27321-
failOnStdErr: true,
27320+
silent: false,
27321+
failOnStdErr: false,
2732227322
listeners: {
2732327323
stdline(data) {
2732427324
stdout.push(data);
@@ -30061,11 +30061,11 @@ async function installTrdl(toolName, toolVersion, binPath) {
3006130061
}
3006230062
async function Do$2(trdlCli, gpgCli, inputs) {
3006330063
coreExports.startGroup('Install or self-update trdl.');
30064-
coreExports.debug(format(`parsed inputs=%o`, inputs));
30064+
coreExports.info(format(`parsed inputs=%o`, inputs));
3006530065
const defaults = trdlCli.defaults();
30066-
coreExports.debug(format(`trdl defaults=%o`, defaults));
30066+
coreExports.info(format(`trdl defaults=%o`, defaults));
3006730067
const options = await getOptions(inputs, defaults);
30068-
coreExports.debug(format(`installation options=%o`, options));
30068+
coreExports.info(format(`installation options=%o`, options));
3006930069
const toolCache = findTrdlCache(defaults.repo, options.version);
3007030070
if (toolCache) {
3007130071
coreExports.info(`Installation skipped. trdl@v${options.version} is found at path ${toolCache}.`);
@@ -30077,11 +30077,14 @@ async function Do$2(trdlCli, gpgCli, inputs) {
3007730077
}
3007830078
await gpgCli.mustGnuGP();
3007930079
const [binUrl, sigUrl, ascUrl] = formatDownloadUrls(options.version);
30080-
coreExports.debug(format('%s bin_url=%s', defaults.repo, binUrl));
30081-
coreExports.debug(format('%s sig_url=%s', defaults.repo, sigUrl));
30082-
coreExports.debug(format('%s asc_url=%s', defaults.repo, ascUrl));
30083-
coreExports.info('Downloading signatures.');
30080+
coreExports.info(format('%s binUrl=%s', defaults.repo, binUrl));
30081+
coreExports.info(format('%s sigUrl=%s', defaults.repo, sigUrl));
30082+
coreExports.info(format('%s ascUrl=%s', defaults.repo, ascUrl));
30083+
coreExports.info('Downloading binary and signatures.');
3008430084
const [binPath, sigPath, ascPath] = await downloadParallel(binUrl, sigUrl, ascUrl);
30085+
coreExports.debug(format('%s binPath=%s', defaults.repo, binPath));
30086+
coreExports.debug(format('%s sigPath=%s', defaults.repo, sigPath));
30087+
coreExports.debug(format('%s ascPath=%s', defaults.repo, ascPath));
3008530088
coreExports.info('Importing and verifying gpg keys.');
3008630089
await gpgCli.import(ascPath);
3008730090
await gpgCli.verify(sigPath, binPath);
@@ -30272,6 +30275,7 @@ async function Do(trdlCli, p) {
3027230275
}
3027330276

3027430277
async function Run() {
30278+
coreExports.setCommandEcho(coreExports.isDebug());
3027530279
const p = parsePresetInput();
3027630280
const trdlCli = new TrdlCli();
3027730281
const gpgCli = new GpgCli();

setup-app/dist/index.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

setup-app/src/action.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ import { GpgCli } from '../../lib/gpg-cli'
44
import { Do as DoInstall } from '../../install/src/action'
55
import { Do as DoAdd } from './add'
66
import { Do as DoUse } from './use'
7+
import { isDebug, setCommandEcho } from '@actions/core'
78

89
export async function Run(): Promise<void> {
10+
setCommandEcho(isDebug())
11+
912
const p = parsePresetInput()
1013
const trdlCli = new TrdlCli()
1114
const gpgCli = new GpgCli()

0 commit comments

Comments
 (0)