Skip to content

Commit ab6f4de

Browse files
try out github actions
1 parent 8ac9845 commit ab6f4de

File tree

5 files changed

+82
-0
lines changed

5 files changed

+82
-0
lines changed

.github/workflows/pre-commit.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-python@v3
14+
- uses: pre-commit/action@v3.0.0

.github/workflows/ruby.yaml

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

.tools-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruby 3.3.6

2024/ruby/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Advent of Code
2+
3+
Solutions for [Advent of Code 2024](https://adventofcode.com/2024) 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

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
# Advent of Code
22

3+
[![ruby](https://github.com/invalidusrname/adventofcode/actions/workflows/ruby.yaml/badge.svg)](https://github.com/invalidusrname/adventofcode/actions/workflows/ruby.yaml)
4+
5+
36

47
My solutions for [Advent of Code](https://adventofcode.com) problems.
58

69
See nested folders (year/language) for further information on setting up and running the code.
10+
11+
12+
## Setup
13+
14+
```
15+
brew install pre-commit
16+
pre-commit install
17+
mise install
18+
```
19+
20+
### Running exercises
21+
22+
See instructions in each language subdirectory

0 commit comments

Comments
 (0)