Skip to content

Commit 6b9b15e

Browse files
authored
Static linking (#39)
1 parent 4e6d9eb commit 6b9b15e

7 files changed

Lines changed: 189 additions & 189 deletions

File tree

.github/actions/plan/plan.js

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const allPlatforms = {
1818
buildEnvScript: buildEnvScriptPath("windows.sh"),
1919
essential: false,
2020
env: {
21-
CARGO_INCREMENTAL: "0"
21+
CARGO_INCREMENTAL: "0",
2222
},
2323
cacheKey: "windows-amd64",
2424
isBroken: false,
@@ -83,45 +83,53 @@ const buildModes = {
8383
cargoArgs: "--release",
8484
cargoCacheKey: "release-build",
8585
},
86-
}
86+
};
8787

8888
const code = () => {
8989
// Compute the effective list of platforms to use.
90-
const effectivePlatforms = Object.values(allPlatforms).filter(platform => !platform.isBroken && platform.essential);
90+
const effectivePlatforms = Object.values(allPlatforms).filter(
91+
(platform) => !platform.isBroken && platform.essential
92+
);
9193

9294
// Compute the effective list of modes that should run for each of the platforms.
93-
const effectiveModes = Object.values(codeModes).filter(mode => !mode.platformIndependent);
95+
const effectiveModes = Object.values(codeModes).filter(
96+
(mode) => !mode.platformIndependent
97+
);
9498

9599
// Compute the effective list of modes that are platform indepedent and only
96100
// have to be run once.
97-
const effectiveIndepModes = Object.values(codeModes).filter(mode => mode.platformIndependent);
101+
const effectiveIndepModes = Object.values(codeModes).filter(
102+
(mode) => mode.platformIndependent
103+
);
98104

99105
// Compute the individual mixins for indep modes.
100-
const effectiveIncludes = effectiveIndepModes.map(mode => ({
106+
const effectiveIncludes = effectiveIndepModes.map((mode) => ({
101107
// Run the platform independent tests on Ubuntu.
102108
platform: allPlatforms.ubuntu,
103109
mode,
104-
}))
110+
}));
105111

106112
// Prepare the effective matrix.
107113
const matrix = provideMatrix(
108114
{
109115
platform: effectivePlatforms,
110116
mode: effectiveModes,
111117
},
112-
effectiveIncludes,
118+
effectiveIncludes
113119
);
114120

115121
// Print the matrix, useful for local debugging.
116122
logMatrix(matrix);
117123

118124
// Export the matrix so it's available to the Github Actions script.
119125
return matrix;
120-
}
126+
};
121127

122128
const build = () => {
123129
// Compute the effective list of platforms to use.
124-
const effectivePlatforms = Object.values(allPlatforms).filter(platform => !platform.isBroken);
130+
const effectivePlatforms = Object.values(allPlatforms).filter(
131+
(platform) => !platform.isBroken
132+
);
125133

126134
// Compute the effective list of modes that should run for each of the platforms.
127135
const effectiveModes = Object.values(buildModes);
@@ -140,20 +148,29 @@ const build = () => {
140148

141149
// Export the matrix so it's available to the Github Actions script.
142150
return matrix;
143-
}
151+
};
144152

145153
const evalMatrix = (dimensions, includes) => {
146-
const evalNext = (allVariants, key, values) => allVariants.flatMap((variant) => values.map(value => ({...variant, [key]: value })))
147-
const dimensionKeys = Object.keys(dimensions)
148-
const evaluated = dimensionKeys.reduce((allVariants, dimensionKey) => evalNext(allVariants, dimensionKey, dimensions[dimensionKey]), [{}])
149-
return [...evaluated, ...includes]
150-
}
154+
const evalNext = (allVariants, key, values) =>
155+
allVariants.flatMap((variant) =>
156+
values.map((value) => ({ ...variant, [key]: value }))
157+
);
158+
const dimensionKeys = Object.keys(dimensions);
159+
const evaluated = dimensionKeys.reduce(
160+
(allVariants, dimensionKey) =>
161+
evalNext(allVariants, dimensionKey, dimensions[dimensionKey]),
162+
[{}]
163+
);
164+
return [...evaluated, ...includes];
165+
};
151166

152-
const provideMatrix = (dimensions, includes) => ({ plan: evalMatrix(dimensions, includes) })
167+
const provideMatrix = (dimensions, includes) => ({
168+
plan: evalMatrix(dimensions, includes),
169+
});
153170

154-
const logMatrix = (matrix) => console.log(JSON.stringify(matrix, null, ' '));
171+
const logMatrix = (matrix) => console.log(JSON.stringify(matrix, null, " "));
155172

156173
module.exports = {
157174
code,
158175
build,
159-
}
176+
};

0 commit comments

Comments
 (0)