Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test] Get multiline action input - parse as JSON #555

Closed
wants to merge 9 commits into from
Closed
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
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ jobs:
# test_msgs depends on test_interface_files, which should be installed by rosdep
# If the dependencies are installed for the wrong distribution, then the build should fail
package-name: test_msgs
colcon-defaults: |
{
"build": {
"mixin": "build-mixin",
"packages-up-to": "something",
"symlink-install": true
}
}
# Verify that rosdep installed the required Debian package
- run: dpkg -s ros-${{ matrix.ros_distribution }}-test-interface-files

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ inputs:
default: "https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml"
description: "Mixin repository containing the mixin specified in colcon-mixin-name"
required: false
colcon-defaults:
required: false
default: ""
description: "Test test"
coverage-ignore-pattern:
description: |
Ignore all files matching this pattern in the coverage report.
Expand Down
6 changes: 6 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11036,6 +11036,12 @@ function run() {
if (!validateDistros(targetRos1Distro, targetRos2Distro)) {
return;
}
const colcon_defaults_content = core.getInput("colcon-defaults");
core.warning(`got the contents ${colcon_defaults_content}`);
const colcon_defaults_parsed = JSON.parse(colcon_defaults_content);
core.warning(`parsed as ${colcon_defaults_parsed}`);
core.setFailed(`Content successfully parsed - build values: ${JSON.stringify(colcon_defaults_parsed.build)}`);
return;
// rosdep does not reliably work on Windows, see
// ros-infrastructure/rosdep#610 for instance. So, we do not run it.
if (!isWindows) {
Expand Down
12 changes: 11 additions & 1 deletion src/action-ros-ci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import fs from "fs";
import retry from "async-retry";
import * as dep from "./dependencies";

import YAML from 'yaml';

// All command line flags passed to curl when invoked as a command.
const curlFlagsArray = [
// (HTTP) Fail silently (no output at all) on server errors. This is mostly done to better enable
Expand Down Expand Up @@ -212,6 +214,7 @@ async function run() {
const vcsRepoFileUrlListAsString = core.getInput("vcs-repo-file-url") || "";
let vcsRepoFileUrlList = vcsRepoFileUrlListAsString.split(RegExp("\\s"));


// Check if PR overrides/adds supplemental repos files
const vcsReposOverride = dep.getReposFilesOverride(github.context.payload);
const vcsReposSupplemental = dep.getReposFilesSupplemental(
Expand Down Expand Up @@ -255,6 +258,13 @@ async function run() {
return;
}

const colcon_defaults_content = core.getInput("colcon-defaults");
core.warning(`got the contents ${colcon_defaults_content}`);
const colcon_defaults_parsed = JSON.parse(colcon_defaults_content);
core.warning(`parsed as ${colcon_defaults_parsed}`);
core.setFailed(`Content successfully parsed - build values: ${JSON.stringify(colcon_defaults_parsed.build)}`);
return;

// rosdep does not reliably work on Windows, see
// ros-infrastructure/rosdep#610 for instance. So, we do not run it.
if (!isWindows) {
Expand Down Expand Up @@ -307,7 +317,7 @@ async function run() {
// being built.
let repoFullName = process.env.GITHUB_REPOSITORY as string;
if (github.context.payload.pull_request) {
repoFullName = github.context.payload.pull_request.head.repo.full_name;
repoFullName = github.context.payload.pull_request!.head.repo.full_name;
}
let tokenAuth = importToken;
if (tokenAuth !== "") {
Expand Down