ci: optimize build process and dependencies (#23)

This commit is contained in:
Robert Kaussow 2021-02-19 09:47:48 +01:00 committed by GitHub
parent 44c0e4b328
commit 0b99e6e825
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 21 deletions

View File

@ -6,6 +6,7 @@ local PythonVersion(pyversion='3.6') = {
}, },
commands: [ commands: [
'pip install poetry poetry-dynamic-versioning -qq', 'pip install poetry poetry-dynamic-versioning -qq',
'poetry config experimental.new-installer false',
'poetry install', 'poetry install',
'poetry version', 'poetry version',
'poetry run git-batch --help', 'poetry run git-batch --help',
@ -32,6 +33,7 @@ local PipelineLint = {
commands: [ commands: [
'git fetch -tq', 'git fetch -tq',
'pip install poetry poetry-dynamic-versioning -qq', 'pip install poetry poetry-dynamic-versioning -qq',
'poetry config experimental.new-installer false',
'poetry install', 'poetry install',
'poetry run yapf -dr ./gitbatch', 'poetry run yapf -dr ./gitbatch',
], ],
@ -45,6 +47,7 @@ local PipelineLint = {
commands: [ commands: [
'git fetch -tq', 'git fetch -tq',
'pip install poetry poetry-dynamic-versioning -qq', 'pip install poetry poetry-dynamic-versioning -qq',
'poetry config experimental.new-installer false',
'poetry install', 'poetry install',
'poetry run flake8 ./gitbatch', 'poetry run flake8 ./gitbatch',
], ],
@ -100,6 +103,7 @@ local PipelineSecurity = {
commands: [ commands: [
'git fetch -tq', 'git fetch -tq',
'pip install poetry poetry-dynamic-versioning -qq', 'pip install poetry poetry-dynamic-versioning -qq',
'poetry config experimental.new-installer false',
'poetry install', 'poetry install',
'poetry run bandit -r ./gitbatch -x ./gitbatch/test', 'poetry run bandit -r ./gitbatch -x ./gitbatch/test',
], ],
@ -177,24 +181,35 @@ local PipelineBuildPackage = {
}; };
local PipelineBuildContainer(arch='amd64') = { local PipelineBuildContainer(arch='amd64') = {
local build = if arch == 'arm' then [{
name: 'build',
image: 'python:3.9-alpine',
commands: [
'apk add -Uq --no-cache build-base libressl-dev libffi-dev musl-dev python3-dev git cargo',
'git fetch -tq',
'pip install poetry poetry-dynamic-versioning -qq',
'poetry build',
],
environment: {
CARGO_NET_GIT_FETCH_WITH_CLI: true,
},
}] else [{
name: 'build',
image: 'python:3.9',
commands: [
'git fetch -tq',
'pip install poetry poetry-dynamic-versioning -qq',
'poetry build',
],
}],
kind: 'pipeline', kind: 'pipeline',
name: 'build-container-' + arch, name: 'build-container-' + arch,
platform: { platform: {
os: 'linux', os: 'linux',
arch: arch, arch: arch,
}, },
steps: [ steps: build + [
{
name: 'build',
image: 'python:3.9-alpine',
commands: [
'apk --update --quiet add build-base libffi-dev musl-dev libressl-dev python3-dev cargo git',
'git fetch -tq',
'pip install --upgrade --no-cache-dir pip',
'pip install poetry poetry-dynamic-versioning -qq',
'poetry build',
],
},
{ {
name: 'dryrun', name: 'dryrun',
image: 'thegeeklab/drone-docker:19', image: 'thegeeklab/drone-docker:19',

View File

@ -12,6 +12,7 @@ steps:
commands: commands:
- git fetch -tq - git fetch -tq
- pip install poetry poetry-dynamic-versioning -qq - pip install poetry poetry-dynamic-versioning -qq
- poetry config experimental.new-installer false
- poetry install - poetry install
- poetry run yapf -dr ./gitbatch - poetry run yapf -dr ./gitbatch
environment: environment:
@ -22,6 +23,7 @@ steps:
commands: commands:
- git fetch -tq - git fetch -tq
- pip install poetry poetry-dynamic-versioning -qq - pip install poetry poetry-dynamic-versioning -qq
- poetry config experimental.new-installer false
- poetry install - poetry install
- poetry run flake8 ./gitbatch - poetry run flake8 ./gitbatch
environment: environment:
@ -51,6 +53,7 @@ steps:
image: python:3.6 image: python:3.6
commands: commands:
- pip install poetry poetry-dynamic-versioning -qq - pip install poetry poetry-dynamic-versioning -qq
- poetry config experimental.new-installer false
- poetry install - poetry install
- poetry version - poetry version
- poetry run git-batch --help - poetry run git-batch --help
@ -63,6 +66,7 @@ steps:
image: python:3.7 image: python:3.7
commands: commands:
- pip install poetry poetry-dynamic-versioning -qq - pip install poetry poetry-dynamic-versioning -qq
- poetry config experimental.new-installer false
- poetry install - poetry install
- poetry version - poetry version
- poetry run git-batch --help - poetry run git-batch --help
@ -75,6 +79,7 @@ steps:
image: python:3.8 image: python:3.8
commands: commands:
- pip install poetry poetry-dynamic-versioning -qq - pip install poetry poetry-dynamic-versioning -qq
- poetry config experimental.new-installer false
- poetry install - poetry install
- poetry version - poetry version
- poetry run git-batch --help - poetry run git-batch --help
@ -87,6 +92,7 @@ steps:
image: python:3.9 image: python:3.9
commands: commands:
- pip install poetry poetry-dynamic-versioning -qq - pip install poetry poetry-dynamic-versioning -qq
- poetry config experimental.new-installer false
- poetry install - poetry install
- poetry version - poetry version
- poetry run git-batch --help - poetry run git-batch --help
@ -118,6 +124,7 @@ steps:
commands: commands:
- git fetch -tq - git fetch -tq
- pip install poetry poetry-dynamic-versioning -qq - pip install poetry poetry-dynamic-versioning -qq
- poetry config experimental.new-installer false
- poetry install - poetry install
- poetry run bandit -r ./gitbatch -x ./gitbatch/test - poetry run bandit -r ./gitbatch -x ./gitbatch/test
environment: environment:
@ -202,11 +209,9 @@ platform:
steps: steps:
- name: build - name: build
image: python:3.9-alpine image: python:3.9
commands: commands:
- apk --update --quiet add build-base libffi-dev musl-dev libressl-dev python3-dev cargo git
- git fetch -tq - git fetch -tq
- pip install --upgrade --no-cache-dir pip
- pip install poetry poetry-dynamic-versioning -qq - pip install poetry poetry-dynamic-versioning -qq
- poetry build - poetry build
@ -282,11 +287,9 @@ platform:
steps: steps:
- name: build - name: build
image: python:3.9-alpine image: python:3.9
commands: commands:
- apk --update --quiet add build-base libffi-dev musl-dev libressl-dev python3-dev cargo git
- git fetch -tq - git fetch -tq
- pip install --upgrade --no-cache-dir pip
- pip install poetry poetry-dynamic-versioning -qq - pip install poetry poetry-dynamic-versioning -qq
- poetry build - poetry build
@ -364,11 +367,12 @@ steps:
- name: build - name: build
image: python:3.9-alpine image: python:3.9-alpine
commands: commands:
- apk --update --quiet add build-base libffi-dev musl-dev libressl-dev python3-dev cargo git - apk add -Uq --no-cache build-base libressl-dev libffi-dev musl-dev python3-dev git cargo
- git fetch -tq - git fetch -tq
- pip install --upgrade --no-cache-dir pip
- pip install poetry poetry-dynamic-versioning -qq - pip install poetry poetry-dynamic-versioning -qq
- poetry build - poetry build
environment:
CARGO_NET_GIT_FETCH_WITH_CLI: true
- name: dryrun - name: dryrun
image: thegeeklab/drone-docker:19 image: thegeeklab/drone-docker:19
@ -529,6 +533,6 @@ depends_on:
--- ---
kind: signature kind: signature
hmac: ba5d8a0fd0f6223e221c2d6f0f0af662b1c4dacf850bfb054fef4b3f83455906 hmac: 9dfbb0e1e570c1891f0eef862e933b3e98cc268a96808481dd255a0e2fd3a4d7
... ...