Skip to content

Commit

Permalink
Create workflow for testing for the ruby feature
Browse files Browse the repository at this point in the history
This workflow spins up a devcontainer that uses the ruby feature and checks that ruby is installed.
  • Loading branch information
andrewn617 committed Apr 9, 2024
1 parent 911e367 commit c2d0cbb
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"image": "mcr.microsoft.com/devcontainers/base:1-bookworm",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "true",
"username": "vscode",
"userUid": "1000",
"userGid": "1000",
"upgradePackages": "true"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": "false"
},
"./features/ruby": {}
},
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
1 change: 1 addition & 0 deletions .github/.devcontainer/features
32 changes: 32 additions & 0 deletions .github/workflows/test-ruby-feature.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test ruby feature

on:
push:

jobs:
build:
name: Test ruby feature

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout (GitHub)
uses: actions/checkout@v3

- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and test devcontainer
uses: devcontainers/[email protected]
with:
imageName: ghcr.io/rails/devcontainer/test-ruby-feature
cacheFrom: ghcr.io/rails/devcontainer/test-ruby-feature
subFolder: .github
refFilterForPush: refs/heads/main
runCmd: ruby -v || ( echo "Ruby is not installed."; exit 1 )

0 comments on commit c2d0cbb

Please sign in to comment.