change to .drone.yaml and clean up pipeline

This commit is contained in:
grumbulon 2023-03-08 19:31:30 -05:00
parent 6ea5fee3c6
commit ce83e61f9b
2 changed files with 36 additions and 64 deletions

View file

@ -1,64 +0,0 @@
local testing(version, arch) = {
kind: 'pipeline',
type: 'docker',
name: '%s-%s' % [version, arch],
platform: {
arch: arch,
},
steps: [
{
name: 'lint-backend',
image: 'golangci/golangci-lint',
commands: [
'make lint-backend',
],
},
{
name: 'lint-frontend',
image: 'guergeiro/pnpm',
commands: [
'pnpm i -F frontend',
'make lint-frontend',
],
},
{
name: 'cache',
image: 'golang:%s' % [version],
commands: [
'go mod tidy',
],
depends_on: [
'lint-backend',
'lint-frontend',
],
volumes: [
{
name: 'cache',
path: '/go',
},
],
},
{
name: 'test',
image: 'golang:%s' % [version],
commands: [
'make test-backend',
],
depends_on: [
'cache',
],
volumes: [
{
name: 'cache',
path: '/go',
},
],
},
],
};
[
testing('1.19', 'amd64'),
testing('1.19', 'arm64'),
testing('1.20', 'amd64'),
testing('1.20', 'arm64'),
]

36
.drone.yaml Normal file
View file

@ -0,0 +1,36 @@
kind: 'pipeline'
type: 'docker'
name: pomme-pipeline
steps:
- name: lint-frontend
image: guergeiro/pnpm
commands:
- cd frontend && npm i
- cd .. && make frontend
- make lint-frontend
- name: lint-backend
image: golangci/golangci-lint
commands:
- make lint-backend
- name: cache
image: golang:1.20
commands:
- go mod tidy && go mod vendor
depends_on:
- 'lint-backend'
- 'lint-frontend'
volumes:
- name: 'cache'
- path: '/go'
- name: 'test'
image: golang:1.20
commands:
- 'make test-backend'
depends_on:
- 'cache'
volumes:
- name: 'cache'
- path: '/go'