Browse Source

ci: add pipeline file

ci/buildyboi
andrei 5 years ago
parent
commit
da261014e1
  1. 46
      .ci/pipeline.ts

46
.ci/pipeline.ts

@ -0,0 +1,46 @@
import {
Job,
pushStep,
spawnChildJob,
} from "https://pkg.buildyboi.ci/buildy/[email protected]/mod.ts";
import * as Docker from "https://pkg.buildyboi.ci/buildy/[email protected]/mod.ts";
export async function runTests(job: Job) {
const version: string = job.args.version;
const dockerFileTemplate = `
FROM python:${version}-buster
ADD requirements.txt .
RUN pip install -r requirements.txt flake8
`;
const image = await Docker.buildImage({
dockerfileContents: dockerFileTemplate,
include: ["requirements.txt"],
});
pushStep("Tests");
await Docker.run(`python setup.py test`, {
image: image.id,
});
pushStep("Flake8");
await Docker.run(`flake8 disco/`, {
image: image.id,
});
}
const versionMatrix = ["3.8", "3.7", "3.6"];
export async function run(job: Job) {
for (const version of versionMatrix) {
await spawnChildJob(`.ci/pipeline.ts:runTests`, {
args: {
version: version,
},
alias: `Test Python ${version}`,
});
}
}
Loading…
Cancel
Save