diff --git a/.github/.devcontainer/devcontainer.json b/.github/.devcontainer/devcontainer.json new file mode 100644 index 0000000..639f342 --- /dev/null +++ b/.github/.devcontainer/devcontainer.json @@ -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" +} diff --git a/.github/.devcontainer/features b/.github/.devcontainer/features new file mode 120000 index 0000000..c9012f2 --- /dev/null +++ b/.github/.devcontainer/features @@ -0,0 +1 @@ +../../features \ No newline at end of file diff --git a/.github/workflows/test-ruby-feature.yaml b/.github/workflows/test-ruby-feature.yaml new file mode 100644 index 0000000..076e3a2 --- /dev/null +++ b/.github/workflows/test-ruby-feature.yaml @@ -0,0 +1,33 @@ +name: Test ruby feature + +on: + push: + pull_request: + +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 devcontainer with feature + uses: devcontainers/ci@v0.3 + 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 )