1. local node_runtime(version, arch) = {
    2. type: 'pod',
    3. arch: arch,
    4. containers: [
    5. {
    6. image: 'node:' + version,
    7. },
    8. ],
    9. };
    10. local task_build(version, arch) = {
    11. name: 'build - node ' + version + ' ' + arch,
    12. runtime: node_runtime(version, arch),
    13. environment: {},
    14. steps: [
    15. { type: 'run', command: 'env' },
    16. { type: 'clone' },
    17. { type: 'restore_cache', keys: ['cache-sum-{{ md5sum "package.json" }}', 'cache-date-'], dest_dir: './node_modules' },
    18. { type: 'run', command: 'npm install' },
    19. { type: 'run', command: 'npm run build' },
    20. { type: 'save_cache', key: 'cache-sum-{{ md5sum "package.json" }}', contents: [{ source_dir: './node_modules' }] },
    21. { type: 'save_cache', key: 'cache-date-{{ year }}-{{ month }}-{{ day }}', contents: [{ source_dir: './node_modules' }] },
    22. ],
    23. };
    24. {
    25. runs: [
    26. {
    27. name: 'agola web build/test',
    28. tasks: std.flattenArrays([
    29. [
    30. task_build(version, arch),
    31. ]
    32. for version in ['11', '12']
    33. for arch in ['amd64', 'arm64']
    34. ])
    35. },
    36. ],
    37. }