Skip to content

Commit 133cfaf

Browse files
Merge pull request #1 from invalidusrname/test-rubocop
add rubocop action
2 parents 2da359d + c354e30 commit 133cfaf

File tree

8 files changed

+33
-17
lines changed

8 files changed

+33
-17
lines changed

.github/shared/setup/action.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: "setup ruby"
2+
description: "setup ruby"
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Set up Ruby
8+
uses: ruby/setup-ruby@v1
9+
with:
10+
bundler-cache: true
11+
working-directory: ./2024/ruby

.github/workflows/2018-ruby.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@ jobs:
2626
with:
2727
ruby-version: ${{ steps.determine-ruby-version.outputs.VERSION }}
2828
bundler-cache: true
29+
working-directory: ./2018/ruby
2930
- name: Run tests
3031
run: bundle exec rspec

.github/workflows/2021-ruby.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@ jobs:
2626
with:
2727
ruby-version: ${{ steps.determine-ruby-version.outputs.VERSION }}
2828
bundler-cache: true
29+
working-directory: ./2021/ruby
2930
- name: Run tests
3031
run: bundle exec rspec

.github/workflows/2024-ruby.yaml

+13-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: 2024-ruby
33
on:
44
pull_request:
55
push:
6-
branches: [master]
76
paths:
87
- 2024/ruby/**
98

@@ -12,14 +11,19 @@ defaults:
1211
working-directory: ./2024/ruby
1312

1413
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Setup Ruby
19+
uses: ./.github/shared/setup
20+
- name: Run rubocop
21+
run: bundle exec rubocop
1522
tests:
1623
runs-on: ubuntu-latest
1724
steps:
18-
- uses: actions/checkout@v3
19-
- name: Set up Ruby
20-
uses: ruby/setup-ruby@v1
21-
with:
22-
bundler-cache: true
23-
working-directory: ./2024/ruby
24-
- name: Run tests
25-
run: bundle exec rspec
25+
- uses: actions/checkout@v3
26+
- name: Setup Ruby
27+
uses: ./.github/shared/setup
28+
- name: Run tests
29+
run: bundle exec rspec

2018/ruby/spec/advent_03_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
expect(rectangle.width).to eq(4)
3030
end
3131

32-
it "solves the puzzle", solution: true do
32+
it "solves the puzzle", solution: true, slow: true do
3333
reader = ClaimReader.new(puzzle_input)
3434
claims = reader.process
3535

2018/ruby/spec/advent_05_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
end
2525
end
2626

27-
xit "solves part 1" do
27+
it "solves part 1", slow: true do
2828
reader = AlchemicalReduction.new(puzzle_input)
2929
reader.process
3030

@@ -55,7 +55,7 @@
5555
expect(lowest[1]).to eq(4)
5656
end
5757

58-
xit "solves part 2" do
58+
it "solves part 2", slow: true do
5959
counts = {}
6060

6161
('a'..'z').each do |letter|

2018/ruby/spec/advent_06_spec.rb

+2-3
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,17 @@
3030
expect(c.largest_area).to eq(17)
3131
end
3232

33-
xit "solves part 1" do
33+
it "solves part 1", slow: true do
3434
coordinates = puzzle_input.collect do |item|
3535
Coordinate.new(item[0], item[1])
3636
end
3737

3838
c = ChronalCoordinates.new(coordinates)
39-
# c.print_grid
4039

4140
expect(c.largest_area).to eq(3401)
4241
end
4342

44-
it "solves part 2" do
43+
it "solves part 2", slow: true do
4544
coordinates = puzzle_input.collect do |item|
4645
Coordinate.new(item[0], item[1])
4746
end

2018/ruby/spec/advent_07_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def create_graph(input, weighted = false, seed_weight = 0)
5858
expect(orderer.compressed_order).to eq("CABDFE")
5959
end
6060

61-
xit "figures out the puzzle order" do
61+
it "figures out the puzzle order", slow: true do
6262
graph = create_graph(puzzle_input)
6363

6464
orderer = Orderer.new(graph)
@@ -76,7 +76,7 @@ def create_graph(input, weighted = false, seed_weight = 0)
7676
expect(seconds).to eq(15)
7777
end
7878

79-
xit "figures out part 2 puzzle order" do
79+
it "figures out part 2 puzzle order", slow: true do
8080
graph = create_graph(puzzle_input, true, 60)
8181

8282
orderer = Orderer.new(graph)

0 commit comments

Comments
 (0)