From 0569f7cab9a24909e7478a77ffaa2598693882a2 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 8 Jan 2024 18:30:22 -0300 Subject: [PATCH] ci: caches --- .gitlab-ci.yml | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cb4cd1e1..45671a40 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,18 +2,27 @@ - "apk add go-task diffutils" .disable-hainish: &disable-hainish - "echo \"HAINISH=\" >> .env.production" +.cache-ruby: &cache-ruby +- paths: + - "vendor/ruby" +.cache-node: &cache-node +- paths: + - "node_modules" +.cache-task: &cache-task +- paths: + - ".task" image: "gitea.nulo.in/sutty/panel:3.17.3-3.1.4-rails" variables: RAILS_ENV: "production" LC_ALL: "C.UTF-8" HAINISH: "" cache: - paths: - - "vendor/ruby" - - "node_modules" - - ".task" assets: stage: "deploy" + cache: + - *cache-ruby + - *cache-node + - *cache-task before_script: - "git config --global user.email \"${GIT_USER_EMAIL:-$GITLAB_USER_EMAIL}\"" - "git config --global user.name \"${GIT_USER_NAME:-$GITLAB_USER_NAME}\"" @@ -28,6 +37,8 @@ assets: - "git push -o ci.skip" gem-audit: stage: "test" + cache: + - *cache-ruby before_script: - "gem install bundler-audit" - *apk-add @@ -36,6 +47,8 @@ gem-audit: - "go-task gem-audit" node-audit: stage: "test" + cache: + - *cache-node before_script: - *apk-add - *disable-hainish @@ -44,6 +57,8 @@ node-audit: - "go-task node-audit" brakeman: stage: "test" + cache: + - *cache-ruby rules: - if: "$CI_PIPELINE_SOURCE == 'merge_request_event'" before_script: @@ -53,6 +68,8 @@ brakeman: - "go-task bundle -- exec brakeman" rubocop: stage: "test" + cache: + - *cache-ruby rules: - if: "$CI_PIPELINE_SOURCE == 'merge_request_event'" before_script: @@ -62,6 +79,8 @@ rubocop: - "./bin/modified_files | grep .rb | xargs -r go-task bundle -- exec rubocop" haml: stage: "test" + cache: + - *cache-ruby rules: - if: "$CI_PIPELINE_SOURCE == 'merge_request_event'" before_script: