Skip to content

Commit df8531e

Browse files
committed
chore: add devcontainer contributor workflow
1 parent e78ea71 commit df8531e

6 files changed

Lines changed: 83 additions & 31 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ARG JAVA_VERSION=8
2+
FROM eclipse-temurin:${JAVA_VERSION}-jdk-jammy
3+
4+
RUN apt-get update \
5+
&& apt-get install -y --no-install-recommends curl git openssh-client \
6+
&& rm -rf /var/lib/apt/lists/*

.devcontainer/devcontainer.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "contentful.java",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"context": "..",
6+
"args": {
7+
"JAVA_VERSION": "${localEnv:JAVA_VERSION:8}"
8+
}
9+
},
10+
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
11+
"remoteUser": "vscode",
12+
"postCreateCommand": "./mvnw -B -q -DskipTests dependency:go-offline",
13+
"customizations": {
14+
"vscode": {
15+
"extensions": [
16+
"redhat.java"
17+
]
18+
}
19+
}
20+
}

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
test:
14+
name: Test (Java 8)
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Run tests in dev container
20+
uses: devcontainers/ci@v0.3
21+
env:
22+
JAVA_VERSION: "8"
23+
with:
24+
push: never
25+
runCmd: ./mvnw -B test

.travis.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Contributing
2+
3+
Thanks for helping improve `contentful.java`.
4+
5+
## Development with Dev Containers
6+
7+
This repository includes a `.devcontainer` configuration for a reproducible local setup. GitHub Actions uses the same devcontainer configuration for CI.
8+
9+
1. Install Docker and a devcontainer-compatible editor. Visual Studio Code with the Dev Containers extension works well.
10+
2. Open the repository in the dev container and wait for the post-create setup to finish.
11+
3. Verify the environment:
12+
13+
```bash
14+
./mvnw -B test
15+
```
16+
17+
## Pull Requests
18+
19+
1. Fork the repository and create a branch for your change.
20+
2. Run the relevant checks from the dev container.
21+
3. Open a pull request with a short summary of the change and any follow-up context.

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
contentful.java - Contentful Java Delivery Library
1414
==================================================
15-
[![Build Status](https://travis-ci.org/contentful/contentful.java.svg)](https://travis-ci.org/contentful/contentful.java/builds#)
15+
[![CI](https://github.com/contentful/contentful.java/actions/workflows/ci.yml/badge.svg)](https://github.com/contentful/contentful.java/actions/workflows/ci.yml)
1616

1717
> Java library for [Content Delivery API](https://www.contentful.com/developers/docs/references/content-delivery-api/) and [Content Preview API](https://www.contentful.com/developers/docs/references/content-preview-api/). It helps in easily accessing the content stored in Contentful using Java applications.
1818
@@ -513,6 +513,16 @@ Getting involved
513513

514514
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?maxAge=31557600)](http://makeapullrequest.com)
515515

516+
For a reproducible local setup, open this repository in its included dev container. The container installs the project dependencies automatically when it is created.
517+
518+
After the container is ready, run:
519+
520+
```bash
521+
./mvnw -B test
522+
```
523+
524+
See [CONTRIBUTING.md](CONTRIBUTING.md) for the full contributor workflow.
525+
516526
Code of Conduct
517527
===============
518528

0 commit comments

Comments
 (0)