Skip to content

Commit eb21222

Browse files
add 2021 workflow
1 parent 7ff4e59 commit eb21222

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

.github/workflows/2021-ruby.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: 2021-ruby
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
paths:
8+
- 2021/ruby/**
9+
10+
defaults:
11+
run:
12+
working-directory: ./2021/ruby
13+
14+
jobs:
15+
tests:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Determine ruby version
20+
id: determine-ruby-version
21+
run: |
22+
VERSION=$(cat .ruby-version)
23+
echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT"
24+
- name: Set up Ruby
25+
uses: ruby/setup-ruby@v1
26+
with:
27+
ruby-version: ${{ steps.determine-ruby-version.outputs.VERSION }}
28+
bundler-cache: true
29+
- name: Install gems
30+
run: |
31+
gem update bundler
32+
bundle
33+
- name: Run tests
34+
run: bundle exec rspec

2021/ruby/README.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Advent of Code
2+
3+
Solutions for [Advent of Code 2021](https://adventofcode.com/2021) done in Ruby
4+
5+
## Setup
6+
7+
bundle install --binstubs
8+
9+
### Runnning tests
10+
11+
./bin/rspec spec
12+
13+
### Code style
14+
15+
Keep style up to date with rubocop:
16+
17+
./bin/rubocop --auto-gen-config
18+
# remove auto-correctable files from rubocop_todo.yml
19+
./bin/rubocop -a

0 commit comments

Comments
 (0)