From 879e7123e8a7db2089c728c2ffb0292a27e507d9 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 2 Feb 2021 20:08:09 +0100 Subject: [PATCH] chore(gitlab-ci): run profiling build automatically --- .gitlab-ci.yml | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d542369f3..1529170f8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,7 +51,7 @@ npm install: artifacts: paths: - node_modules/ - name: "${CI_JOB_NAME}" + name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}" expire_in: "1 day" retry: 2 interruptible: true @@ -68,7 +68,7 @@ frontend:build: - static - well-known - config/webpack.yml - name: "${CI_JOB_NAME}" + name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}" expire_in: "1 day" dependencies: - npm install @@ -112,14 +112,17 @@ yesod:build:dev: artifacts: paths: - bin/ - name: "${CI_JOB_NAME}" + name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}" expire_in: "1 week" dependencies: - frontend:build - only: - variables: - - $CI_COMMIT_REF_NAME !~ /^v[0-9].*/ + rules: + - if: $CI_COMMIT_REF_NAME !~ /^v[0-9].*/ + when: always + - if: $CI_COMMIT_REF_NAME =~ /^v[0-9].*/ + when: manual + retry: 2 interruptible: true @@ -135,13 +138,16 @@ yesod:build: artifacts: paths: - bin/ - name: "${CI_JOB_NAME}" + name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}" dependencies: - frontend:build - only: - variables: - - $CI_COMMIT_REF_NAME =~ /^v[0-9].*/ + rules: + - if: $CI_COMMIT_REF_NAME =~ /^v[0-9].*/ + when: always + - if: $CI_COMMIT_REF_NAME !~ /^v[0-9].*/ + when: manual + retry: 2 interruptible: true resource_group: ram @@ -151,8 +157,6 @@ yesod:build:profile: <<: *global_cache policy: pull - services: *build-services - stage: yesod:build script: - stack build --profile --copy-bins --local-bin-path $(pwd)/bin --flag uniworx:-library-only --flag uniworx:-dev --flag uniworx:pedantic --no-strip @@ -162,11 +166,15 @@ yesod:build:profile: artifacts: paths: - bin/ - name: "${CI_JOB_NAME}" + name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}" dependencies: - frontend:build - when: manual + rules: + - if: $CI_COMMIT_REF_NAME =~ /(^|\/)profile($|\/)/ + when: always + - if: $CI_COMMIT_REF_NAME !~ /(^|\/)profile($|\/)/ + when: manual retry: 2 interruptible: true