Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions .circleci/config.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ARG RUBY_VERSION=3.4
FROM mcr.microsoft.com/devcontainers/ruby:1-${RUBY_VERSION}-bookworm

RUN gem install bundler:2.3.26 --no-document
24 changes: 24 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "contentful.rb",
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {
"RUBY_VERSION": "${localEnv:RUBY_VERSION:3.4}"
}
},
"containerEnv": {
"BUNDLE_APP_CONFIG": "/home/vscode/.bundle",
"BUNDLE_PATH": "/home/vscode/.bundle/vendor"
},
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"remoteUser": "vscode",
"postCreateCommand": "bundle _2.3.26_ install",
"customizations": {
"vscode": {
"extensions": [
"Shopify.ruby-lsp"
]
}
}
}
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
push:
branches: [master]
pull_request:
branches: [master]

permissions:
contents: read

jobs:
test-and-lint:
name: Test and lint (Ruby ${{ matrix.ruby-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version: ["3.2", "3.3", "3.4"]
steps:
- uses: actions/checkout@v5

- name: Install devcontainer CLI
run: npm install -g @devcontainers/cli@0

- name: Run tests and lint checks in dev container
env:
RUBY_VERSION: ${{ matrix.ruby-version }}
run: |
devcontainer up --workspace-folder .
devcontainer exec --workspace-folder . bash -lc "bundle _2.3.26_ exec rake rspec_rubocop"
32 changes: 0 additions & 32 deletions .github/workflows/codeql.yml

This file was deleted.

39 changes: 39 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Contributing

Thanks for helping improve `contentful.rb`.

## Development with Dev Containers

This repository includes a `.devcontainer` configuration for a reproducible local setup. GitHub Actions uses the same devcontainer configuration for CI.

### Visual Studio Code

Open the repository in Visual Studio Code, install the Dev Containers extension if needed, then run `Dev Containers: Reopen in Container`. Wait for the container build and post-create setup to finish.

### Terminal or other editors

Install Docker and the Dev Container CLI (`npm install -g @devcontainers/cli`). From the repository root, run:

```bash
devcontainer up --workspace-folder .
devcontainer exec --workspace-folder . bash
```

### Verify the environment

```bash
bundle exec rake rspec_rubocop
```

## Other Useful Commands

```bash
bundle exec rake spec
bundle exec rake rubocop
```

## Pull Requests

1. Fork the repository and create a branch for your change.
2. Run the relevant checks from the dev container.
3. Open a pull request with a short summary of the change and any follow-up context.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<img src="https://img.shields.io/badge/license-MIT-brightgreen.svg" alt="MIT License" />
</a>
&nbsp;
<a href="https://app.circleci.com/pipelines/github/contentful/contentful.rb?branch=master">
<img src="https://circleci.com/gh/contentful/contentful.rb/tree/master.svg?style=svg" alt="CircleCI">
<a href="https://github.com/contentful/contentful.rb/actions/workflows/ci.yml">
<img src="https://github.com/contentful/contentful.rb/actions/workflows/ci.yml/badge.svg" alt="CI">
</a>
</p>

Expand Down Expand Up @@ -758,6 +758,14 @@ For more information on the internal changes present in the 2.x release, please

We appreciate any help on our repositories. For more details about how to contribute see our [CONTRIBUTING.md](CONTRIBUTING.md) document.

For a reproducible local setup, open this repository in its included dev container. The container installs the project dependencies automatically when it is created.

After the container is ready, run:

```bash
bundle exec rake rspec_rubocop
```

## License

This repository is published under the [MIT](LICENSE.txt) license.
Expand Down
Loading