From 2e9e3340d78ce282e563e7e78f34eaf0addb0cad Mon Sep 17 00:00:00 2001 From: a14m Date: Tue, 8 Dec 2020 16:18:49 +0100 Subject: Remove travis CI, sad that it's not working at all with gitlab --- .travis.yml | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6541a49..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: ruby - -ruby: - - 2.5 - - 2.6 - - 2.7 - -before_install: - - gem install bundler - - cd CLI/ruby - -jobs: - include: - - stage: lint - ruby: 2.7 - script: bundle exec rubocop -- cgit v1.2.3 From 9df819353fadc6a02b037b105f3ca2e0e2a9e1f0 Mon Sep 17 00:00:00 2001 From: a14m Date: Wed, 9 Dec 2020 09:41:03 +0100 Subject: Configure ruby build/test/lint steps --- .gitlab-ci.yml | 10 ++++++++++ CLI/ruby/.gitlab-ci.yml | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 CLI/ruby/.gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..07f1eec --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,10 @@ +stages: + - triggers + +ruby: + stage: triggers + trigger: + include: CLI/ruby/.gitlab-ci.yml + rules: + - changes: + - CLI/ruby/* diff --git a/CLI/ruby/.gitlab-ci.yml b/CLI/ruby/.gitlab-ci.yml new file mode 100644 index 0000000..914821f --- /dev/null +++ b/CLI/ruby/.gitlab-ci.yml @@ -0,0 +1,39 @@ +image: ruby:2.7 + +stages: + - build + - test + - lint + - release + +variables: + BUNDLE_PATH: .bundle/vendor + +cache: + key: + files: + - Gemfile.lock + paths: + - CLI/ruby/.bundle/vendor + +before_script: + - cd CLI/ruby + - bundle install -j $(nproc) + +build: + stage: build + script: + - ruby -v + - bundle env + +test: + stage: test + needs: [build] + script: + - bundle exec rspec + +lint: + stage: test + needs: [build] + script: + - bundle exec rubocop -- cgit v1.2.3 From 18d7b02558c34160f2e80d3380a2530723b325b0 Mon Sep 17 00:00:00 2001 From: a14m Date: Wed, 9 Dec 2020 13:09:14 +0100 Subject: Speed up by providing cache policies (push when needed only in build) And mirror child status on pipeline --- .gitlab-ci.yml | 11 ++++++++--- CLI/ruby/.gitlab-ci.yml | 9 ++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 07f1eec..49038d5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,6 +5,11 @@ ruby: stage: triggers trigger: include: CLI/ruby/.gitlab-ci.yml - rules: - - changes: - - CLI/ruby/* + strategy: depend + only: + refs: + - master + - branches + - merge_requests + changes: + - CLI/ruby/* diff --git a/CLI/ruby/.gitlab-ci.yml b/CLI/ruby/.gitlab-ci.yml index 914821f..f96599c 100644 --- a/CLI/ruby/.gitlab-ci.yml +++ b/CLI/ruby/.gitlab-ci.yml @@ -9,7 +9,8 @@ stages: variables: BUNDLE_PATH: .bundle/vendor -cache: +cache: &cache + policy: pull-push key: files: - Gemfile.lock @@ -29,11 +30,17 @@ build: test: stage: test needs: [build] + cache: + <<: *cache + policy: pull script: - bundle exec rspec lint: stage: test needs: [build] + cache: + <<: *cache + policy: pull script: - bundle exec rubocop -- cgit v1.2.3