Skip to content

Commit 3541795

Browse files
author
dcalixto
committed
added workflow and circlei
1 parent 771c115 commit 3541795

File tree

5 files changed

+54
-4
lines changed

5 files changed

+54
-4
lines changed

.circleci/config.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: 2.1
2+
3+
jobs:
4+
build:
5+
docker:
6+
- image: crystallang/crystal:latest
7+
steps:
8+
- checkout
9+
- run:
10+
name: Install dependencies
11+
command: shards install
12+
- run:
13+
name: Run tests
14+
command: crystal spec
15+
16+
workflows:
17+
version: 2
18+
build_and_test:
19+
jobs:
20+
- build

.github/workflows/crystal-test.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Crystal Test
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: ["**"]
7+
pull_request:
8+
branches: ["**"]
9+
10+
jobs:
11+
crystal_test:
12+
name: Crystal Test
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
crystal-version: ["1.9", "1.10"]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up Crystal
22+
uses: crystal-lang/install-crystal@v1
23+
with:
24+
crystal: ${{ matrix.crystal-version }}
25+
26+
- name: Install dependencies
27+
run: shards install
28+
29+
- name: Run specs
30+
run: crystal spec

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A Crystal shard for creating human-readable URLs and slugs. FriendlyId lets you create pretty URLs and slugs for your resources, with support for history tracking and customization.
44

5-
![Build Status](https://1acb-2804-1b1-c802-c90c-2e6c-3569-397e-7ead.ngrok-free.app/buildStatus/icon?job=friendly_id&style=flat)
5+
[![Crystal Test](https://github.com/dcalixto/friendly_id/actions/workflows/crystal-test.yml/badge.svg?branch=master)](https://github.com/dcalixto/friendly_id/actions/workflows/crystal-test.yml)
66

77
## Installation
88

spec/support/post.cr

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ class Post
3030
end
3131

3232
def update!(title : String)
33-
# Store old slug before any changes
34-
old_slug = @slug.try(&.dup)
35-
@slug_changed = true # Add this line
33+
# Store the previous slug before making any changes
34+
@previous_slug = @slug.try(&.dup)
35+
@slug_changed = true
3636

3737
before_save
3838
@title = title

0 commit comments

Comments
 (0)