All checks were successful
continuous-integration/drone/push Build is passing
166 lines
4.1 KiB
YAML
166 lines
4.1 KiB
YAML
kind: pipeline
|
|
type: docker
|
|
name: build
|
|
|
|
environment:
|
|
ASDF_DATA_DIR: /drone/src/.asdf
|
|
ASDF_DIR: /root/.asdf
|
|
BUNDLE_CACHE_PATH: /drone/src/.bundle
|
|
|
|
steps:
|
|
- name: restore ASDF cache
|
|
image: meltwater/drone-cache
|
|
pull: "always"
|
|
environment:
|
|
AWS_ACCESS_KEY_ID:
|
|
from_secret: ACCESS_KEY_ID
|
|
AWS_SECRET_ACCESS_KEY:
|
|
from_secret: SECRET_ACCESS_KEY
|
|
AWS_PLUGIN_PATH_STYLE: true
|
|
settings:
|
|
restore: true
|
|
endpoint:
|
|
from_secret: S3_ENDPOINT
|
|
bucket:
|
|
from_secret: CACHE_BUCKET
|
|
region: us-east-1
|
|
path-style: true
|
|
cache_key: 'asdf-{{ os }}-{{ arch }}-{{ checksum ".tool-versions" }}'
|
|
mount:
|
|
- .asdf
|
|
|
|
- name: restore bundle cache
|
|
image: meltwater/drone-cache
|
|
pull: "always"
|
|
environment:
|
|
AWS_ACCESS_KEY_ID:
|
|
from_secret: ACCESS_KEY_ID
|
|
AWS_SECRET_ACCESS_KEY:
|
|
from_secret: SECRET_ACCESS_KEY
|
|
AWS_PLUGIN_PATH_STYLE: true
|
|
settings:
|
|
restore: true
|
|
endpoint:
|
|
from_secret: S3_ENDPOINT
|
|
bucket:
|
|
from_secret: CACHE_BUCKET
|
|
region: us-east-1
|
|
path-style: true
|
|
cache_key: 'bundle-{{ checksum "Gemfile.lock" }}-{{ checksum ".tool-versions" }}'
|
|
mount:
|
|
- .bundle
|
|
|
|
- name: install dependencies
|
|
image: harton.dev/james/asdf_container:latest
|
|
pull: "always"
|
|
depends_on:
|
|
- restore ASDF cache
|
|
- restore bundle cache
|
|
commands:
|
|
- apt-get update
|
|
- apt-get install -y wabt
|
|
- rm -rf /var/cache/apt
|
|
- mkdir -p bin
|
|
- cp -v /usr/bin/wat2wasm bin/
|
|
- cp -v /usr/bin/wasm-validate bin/
|
|
- asdf_install
|
|
- rm -rf .asdf/downloads
|
|
- . $ASDF_DIR/asdf.sh
|
|
- bundle install
|
|
|
|
- name: store ASDF cache
|
|
image: meltwater/drone-cache
|
|
pull: "always"
|
|
environment:
|
|
AWS_ACCESS_KEY_ID:
|
|
from_secret: ACCESS_KEY_ID
|
|
AWS_SECRET_ACCESS_KEY:
|
|
from_secret: SECRET_ACCESS_KEY
|
|
AWS_PLUGIN_PATH_STYLE: true
|
|
depends_on:
|
|
- install dependencies
|
|
settings:
|
|
rebuild: true
|
|
override: false
|
|
endpoint:
|
|
from_secret: S3_ENDPOINT
|
|
bucket:
|
|
from_secret: CACHE_BUCKET
|
|
region: us-east-1
|
|
path-style: true
|
|
cache_key: 'asdf-{{ os }}-{{ arch }}-{{ checksum ".tool-versions" }}'
|
|
mount:
|
|
- .asdf
|
|
|
|
- name: store bundle cache
|
|
image: meltwater/drone-cache
|
|
pull: "always"
|
|
environment:
|
|
AWS_ACCESS_KEY_ID:
|
|
from_secret: ACCESS_KEY_ID
|
|
AWS_SECRET_ACCESS_KEY:
|
|
from_secret: SECRET_ACCESS_KEY
|
|
AWS_PLUGIN_PATH_STYLE: true
|
|
depends_on:
|
|
- install dependencies
|
|
settings:
|
|
rebuild: true
|
|
override: false
|
|
endpoint:
|
|
from_secret: S3_ENDPOINT
|
|
bucket:
|
|
from_secret: CACHE_BUCKET
|
|
region: us-east-1
|
|
path-style: true
|
|
cache_key: 'bundle-{{ checksum "Gemfile.lock" }}-{{ checksum ".tool-versions" }}'
|
|
mount:
|
|
- .bundle
|
|
|
|
- name: store WABT cache
|
|
image: meltwater/drone-cache
|
|
pull: "always"
|
|
environment:
|
|
AWS_ACCESS_KEY_ID:
|
|
from_secret: ACCESS_KEY_ID
|
|
AWS_SECRET_ACCESS_KEY:
|
|
from_secret: SECRET_ACCESS_KEY
|
|
AWS_PLUGIN_PATH_STYLE: true
|
|
depends_on:
|
|
- install dependencies
|
|
settings:
|
|
rebuild: true
|
|
override: false
|
|
endpoint:
|
|
from_secret: S3_ENDPOINT
|
|
bucket:
|
|
from_secret: CACHE_BUCKET
|
|
region: us-east-1
|
|
path-style: true
|
|
cache_key: "wabt"
|
|
mount:
|
|
- bin
|
|
|
|
- name: rubocop
|
|
image: harton.dev/james/asdf_container:latest
|
|
pull: "always"
|
|
environment:
|
|
BUNDLE_CACHE_PATH: /drone/src/.bundle
|
|
ASDF_DATA_DIR: /drone/src/.asdf
|
|
depends_on:
|
|
- install dependencies
|
|
commands:
|
|
- . $ASDF_DIR/asdf.sh
|
|
- bundle exec rubocop
|
|
|
|
- name: rspec
|
|
image: harton.dev/james/asdf_container:latest
|
|
pull: "always"
|
|
environment:
|
|
BUNDLE_CACHE_PATH: /drone/src/.bundle
|
|
ASDF_DATA_DIR: /drone/src/.asdf
|
|
depends_on:
|
|
- install dependencies
|
|
commands:
|
|
- export PATH=/drone/src/bin:$PATH
|
|
- . $ASDF_DIR/asdf.sh
|
|
- bundle exec rspec
|