Skip to content

Commit 8c43053

Browse files
committed
Refresh the CI
- Use github actions instead of travis (with checkout@v6) - Use Policyfile instead of Berkshelf - Bump gems dependencies - Use kitchen dokken - Target CentOS / Rockylinux 8 in tests - Remove rspec coverage (slowing down the CI)
1 parent 9c44892 commit 8c43053

23 files changed

Lines changed: 165 additions & 182 deletions
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# This is a basic workflow to help you get started with Actions
2+
name: Criteo Cookbooks CI
3+
on:
4+
# Triggers the workflow on push or pull request events but only for the master branch
5+
push:
6+
branches: [ "main" ]
7+
tags: [ 'v*' ]
8+
pull_request:
9+
branches: [ "main" ]
10+
workflow_dispatch:
11+
jobs:
12+
rspec:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v6
16+
- uses: ruby/setup-ruby@v1
17+
with:
18+
ruby-version: 3.2
19+
bundler-cache: true
20+
- run: bundle exec rubocop --version
21+
- run: bundle exec rubocop
22+
- run: bundle exec rspec
23+
kitchen:
24+
needs: [rspec]
25+
runs-on: ubuntu-latest
26+
strategy:
27+
matrix:
28+
instance: ['scponly-rockylinux-8']
29+
steps:
30+
- uses: actions/checkout@v6
31+
- uses: ruby/setup-ruby@v1
32+
with:
33+
ruby-version: 3.2
34+
bundler-cache: true
35+
- run: CHEF_LICENSE='accept-no-persist' bundle exec kitchen verify ${{ matrix.instance }}
36+
supermarket:
37+
runs-on: ubuntu-latest
38+
if: startsWith(github.ref, 'refs/tags/')
39+
needs: [kitchen]
40+
steps:
41+
- uses: actions/checkout@v6
42+
- name: Publish to supermarket
43+
uses: afaundez/chef-supermarket-action@8cdbe1cccbe1ecd8685b2ea8f48780135bae7cee
44+
with:
45+
user: criteo
46+
cookbook: scponly
47+
category: Utilities
48+
env:
49+
SUPERMARKET_API_KEY: ${{ secrets.SUPERMARKET_API_KEY }}

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.vagrant
2-
Berksfile.lock
32
*~
43
*#
54
.#*
@@ -13,6 +12,4 @@ bin/*
1312
.bundle/*
1413

1514
.kitchen/
16-
.kitchen.local.yml
17-
18-
.cookbook_version
15+
Policyfile.lock.json

.kitchen.ec2.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.kitchen.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.kitchen_suites.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.rubocop.yml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
inherit_from: .rubocop_todo.yml
2+
13
# Rules defined there are of course debatable.
24
# If you want to modify them:
35
# - discuss this with sre-core members
@@ -6,24 +8,22 @@
68
AllCops:
79
TargetRubyVersion: 2.3
810

9-
10-
# This requires to alphabetically sort Gem's requirements
11-
Bundler/OrderedGems:
12-
Enabled: false
13-
1411
# This requires to add a comment inside nearly all file which could be
1512
# considered as toil without value
1613
Style/FrozenStringLiteralComment:
1714
Enabled: false
1815

1916
### Disable line length constraint
20-
Metrics/LineLength:
17+
Layout/LineLength:
2118
Max: 180
2219
# Because we're not in the 80s anymore.
2320
# Based on data from http://sideeffect.kr/popularconvention#ruby
2421
#
2522
### Comma after each line in a list
26-
Style/TrailingCommaInLiteral:
23+
Style/TrailingCommaInArrayLiteral:
24+
EnforcedStyleForMultiline: comma
25+
26+
Style/TrailingCommaInHashLiteral:
2727
EnforcedStyleForMultiline: comma
2828
# It is very common to add key/value pairs to hashes in Chef attributes. Making
2929
# sure each line has a comma diminishes the chance of someone making an error
@@ -43,7 +43,7 @@ Style/TrailingCommaInLiteral:
4343
# }
4444
#
4545
### Align hashes as a table
46-
Layout/AlignHash:
46+
Layout/HashAlignment:
4747
EnforcedColonStyle: table
4848
EnforcedHashRocketStyle: key
4949
# When dealing with long key names, it is easier to read hashes in colon
@@ -73,7 +73,7 @@ Metrics/MethodLength:
7373
Max: 40
7474

7575
# This rule generates many false positive
76-
Style/VariableNumber:
76+
Naming/VariableNumber:
7777
Enabled: false
7878

7979
# This metric is hard to grasp but let's avoid delirious code
@@ -92,21 +92,12 @@ Style/StringLiterals:
9292
Style/FormatString:
9393
EnforcedStyle: percent
9494

95-
# Really practical. Use with moderation though for readability
96-
Style/MultilineBlockChain:
97-
Enabled: false
98-
99-
# We ain't serving subseconds requests. Forcing to use tr instead of gsub will
100-
# be annoying without much value
101-
Performance/StringReplacement:
102-
Enabled: false
103-
10495
# We don't write documentation there at the moment
10596
Style/Documentation:
10697
Enabled: false
10798

10899
# Filename forces snake case for file names, we just want consistency for now
109-
Style/FileName:
100+
Naming/FileName:
110101
Enabled: false
111102

112103
# We don't want CRLF for ruby files, even on windows!

.rubocop_todo.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# This configuration was generated by
2+
# `rubocop --auto-gen-config`
3+
# on 2026-05-18 11:38:31 UTC using RuboCop version 1.81.7.
4+
# The point is for the user to remove these configuration records
5+
# one by one as the offenses are removed from the code base.
6+
# Note that changes in the inspected code, or installation of new
7+
# versions of RuboCop, may require this file to be generated again.
8+
9+
# Offense count: 3
10+
# This cop supports safe autocorrection (--autocorrect).
11+
# Configuration parameters: AllowBorderComment, AllowMarginComment.
12+
Layout/EmptyComment:
13+
Exclude:
14+
- 'spec/spec_helper.rb'
15+
- 'spec/unit/recipes/default_spec.rb'
16+
17+
# Offense count: 1
18+
# This cop supports safe autocorrection (--autocorrect).
19+
Layout/EmptyLines:
20+
Exclude:
21+
- 'spec/spec_helper.rb'
22+
23+
# Offense count: 9
24+
# This cop supports safe autocorrection (--autocorrect).
25+
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
26+
# SupportedHashRocketStyles: key, separator, table
27+
# SupportedColonStyles: key, separator, table
28+
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
29+
Layout/HashAlignment:
30+
Exclude:
31+
- 'spec/providers/add_spec.rb'
32+
33+
# Offense count: 2
34+
# This cop supports safe autocorrection (--autocorrect).
35+
Layout/LeadingEmptyLines:
36+
Exclude:
37+
- 'spec/providers/add_spec.rb'
38+
- 'spec/providers/del_spec.rb'
39+
40+
# Offense count: 6
41+
# This cop supports safe autocorrection (--autocorrect).
42+
# Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
43+
# URISchemes: http, https
44+
Layout/LineLength:
45+
Exclude:
46+
- 'spec/providers/add_spec.rb'
47+
- 'test/cookbooks/scponly_test/recipes/add_user.rb'
48+
- 'test/integration/default/serverspec/check_user_spec.rb'
49+
50+
# Offense count: 1
51+
# This cop supports unsafe autocorrection (--autocorrect-all).
52+
# Configuration parameters: Mode.
53+
Style/StringConcatenation:
54+
Exclude:
55+
- 'providers/user.rb'

.travis.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.travis/client.pem.enc

-1.64 KB
Binary file not shown.

.travis/travis-ci.pem.enc

-1.64 KB
Binary file not shown.

0 commit comments

Comments
 (0)