Compare commits

...

3 Commits

Author SHA1 Message Date
b5a83988e8 Small improvements
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
2022-09-07 22:18:38 +02:00
7bc8c5b967 Bring back Windows support
Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
2022-09-07 22:15:58 +02:00
6bdd545cec Remove unnecessary function buildForArch()
Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
2022-09-07 22:10:29 +02:00

View File

@ -1,41 +1,41 @@
local archs = [
{ target: 'aarch64-unknown-linux-gnu', short: 'arm64-gnu' },
{ target: 'aarch64-unknown-linux-musl', short: 'arm64-musl' },
// { target: 'x86_64-pc-windows-gnu', short: 'windows-amd64' },
{ target: 'x86_64-pc-windows-gnu', short: 'windows-amd64' },
{ target: 'x86_64-unknown-linux-gnu', short: 'amd64-gnu' },
{ target: 'x86_64-unknown-linux-musl', short: 'amd64-musl' },
];
local getStepName(arch) = 'check ' + arch.short;
local getStepName(arch) = 'Build for ' + arch.short;
local buildForArch(arch) = {
name: getStepName(arch),
image: 'img.kie.rs/jjkiers/rust-dind-cross:1.62-slim',
volumes: [
{
name: 'dockersock',
path: '/var/run',
},
{
name: 'rustup',
path: '/usr/local/rustup',
},
],
commands: [
'echo Hello World from Jsonnet on ' + arch.target + '!',
'cross build --release --target ' + arch.target,
'rm -rf target/' + arch.target + '/release/{build,deps,examples,incremental}',
'cp target/' + arch.target + '/release/drone-test artifacts/drone-test-' + arch.short,
],
environment: {
CROSS_REMOTE: true,
},
depends_on: ['wait-for-docker'],
};
local getExeName(arch) = if std.startsWith(arch.short, 'windows') then '.exe' else '';
local check_steps() = [
buildForArch(a)
for a in archs
local add_build_steps() = [
{
name: getStepName(arch),
image: 'img.kie.rs/jjkiers/rust-dind-cross:1.62-slim',
volumes: [
{
name: 'dockersock',
path: '/var/run',
},
{
name: 'rustup',
path: '/usr/local/rustup',
},
],
commands: [
'echo Hello World from Jsonnet on ' + arch.target + '!',
'cross build --release --target ' + arch.target,
'cp target/' + arch.target + '/release/drone-test' + getExeName(arch) + ' artifacts/drone-test-' + arch.short + getExeName(arch),
'rm -rf target/' + arch.target + '/release/*',
],
environment: {
CROSS_REMOTE: true,
},
depends_on: ['wait-for-docker'],
}
for arch in archs
];
{
@ -47,7 +47,7 @@ local check_steps() = [
},
steps:
[{
name: 'wait-for-docker',
name: 'Wait for Docker',
image: 'img.kie.rs/jjkiers/rust-dind-cross:1.62-slim',
commands: [
'while ! docker image ls; do sleep 1; done',
@ -60,13 +60,12 @@ local check_steps() = [
path: '/var/run',
}],
}] +
check_steps() +
add_build_steps() +
[
{
name: 'build',
name: 'Show built artifacts',
image: 'img.kie.rs/jjkiers/rust-dind-cross:1.62-slim',
commands: [
'ls -lah target/',
'ls -lah artifacts',
],
depends_on: [getStepName(a) for a in archs],