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