improve ci

This commit is contained in:
shibao 2023-02-05 10:37:05 -05:00
parent 42e2d1c76e
commit 3f143262d4
3 changed files with 15 additions and 10 deletions

View File

@ -13,20 +13,24 @@ steps:
mount: mount:
- _build - _build
- deps - deps
- assets/node_modules/ - .npm
- .mix
- name: test - name: test
image: elixir:1.14.1-alpine image: elixir:1.14.1-alpine
environment: environment:
TEST_DATABASE_URL: ecto://postgres:postgres@database/cannery_test TEST_DATABASE_URL: ecto://postgres:postgres@database/cannery_test
HOST: testing.example.tld HOST: testing.example.tld
MIX_HOME: /drone/src/.mix
MIX_ARCHIVES: /drone/src/.mix/archives
MIX_ENV: test
commands: commands:
- apk add --no-cache build-base npm git python3 - apk add --no-cache build-base npm git
- mix local.rebar --force - mix local.rebar --force --if-missing
- mix local.hex --force - mix local.hex --force --if-missing
- mix deps.get - mix deps.get
- mix deps.compile - npm set cache .npm
- npm --prefix ./assets ci --progress=false --no-audit --loglevel=error - npm --prefix ./assets ci --no-audit --prefer-offline
- npm run --prefix ./assets deploy - npm run --prefix ./assets deploy
- mix do phx.digest, gettext.extract - mix do phx.digest, gettext.extract
- mix test.all - mix test.all
@ -76,7 +80,8 @@ steps:
mount: mount:
- _build - _build
- deps - deps
- assets/node_modules/ - .npm
- .mix
services: services:
- name: database - name: database

View File

@ -1,3 +1,3 @@
elixir 1.14.1-otp-25 elixir 1.14.1-otp-25
erlang 25.1.2 erlang 25.1.2
nodejs 18.12.1 nodejs 18.9.1

View File

@ -3,8 +3,8 @@
"description": " ", "description": " ",
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": "18.12.1", "node": "v18.9.1",
"npm": "8.19.2" "npm": "8.10.0"
}, },
"scripts": { "scripts": {
"deploy": "NODE_ENV=production webpack --mode production", "deploy": "NODE_ENV=production webpack --mode production",