Commit 977ad6f8 authored by nanahira's avatar nanahira

tests

parent 68ec0e9e
stages:
- build
- deploy
variables:
GIT_DEPTH: "1"
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
.build-image:
stage: build
script:
- docker build --pull -t $TARGET_IMAGE .
- docker push $TARGET_IMAGE
build-x86:
extends: .build-image
tags:
- docker
variables:
TARGET_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-x86
build-arm:
extends: .build-image
tags:
- docker-arm
variables:
TARGET_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-arm
.deploy:
stage: deploy
tags:
- docker
script:
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-x86
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-arm
- docker manifest create $TARGET_IMAGE --amend $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-x86 --amend
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-arm
- docker manifest push $TARGET_IMAGE
deploy_latest:
extends: .deploy
variables:
TARGET_IMAGE: $CI_REGISTRY_IMAGE:latest
only:
- master
deploy_branch:
extends: .deploy
variables:
TARGET_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
stages:
- install
- build
- deploy
variables:
GIT_DEPTH: "1"
npm_ci:
stage: install
tags:
- linux
script:
- npm ci
artifacts:
paths:
- node_modules
.build_base:
stage: build
tags:
- linux
dependencies:
- npm_ci
build:
extends: .build_base
script: npm run build
artifacts:
paths:
- dist/
upload_to_minio:
stage: deploy
dependencies:
- build
tags:
- linux
script:
- aws s3 --endpoint=https://minio.momobako.com:9000 sync --delete dist/ s3://nanahira/path
only:
- master
...@@ -28,8 +28,8 @@ describe('workflow – basics', () => { ...@@ -28,8 +28,8 @@ describe('workflow – basics', () => {
} }
const a = new A(); const a = new A();
const result = workflow(a).foo().bar().baz()().value; const result = await workflow(a).foo().bar().baz()().value;
await expect(result).resolves.toBe(109); await expect(result).toBe(109);
}); });
it('property-only terminal await works', async () => { it('property-only terminal await works', async () => {
...@@ -37,8 +37,8 @@ describe('workflow – basics', () => { ...@@ -37,8 +37,8 @@ describe('workflow – basics', () => {
value = 7; value = 7;
} }
const a = new A(); const a = new A();
const result = workflow(a).value; const result = await workflow(a).value;
await expect(result).resolves.toBe(7); await expect(result).toBe(7);
}); });
it('throws when invoking a non-function value', async () => { it('throws when invoking a non-function value', async () => {
...@@ -249,7 +249,7 @@ describe('workflow – property chains', () => { ...@@ -249,7 +249,7 @@ describe('workflow – property chains', () => {
cfg = { feature: { enabled: true as boolean } }; cfg = { feature: { enabled: true as boolean } };
} }
const result = await workflow(new A()).cfg.feature.enabled; const result = await workflow(new A()).cfg.feature.enabled;
await expect(result).resolves.toBe(true); await expect(result).toBe(true);
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment