Skip to content

Commit

Permalink
Merge pull request rails#51559 from Shopify/devcontainer-workflow
Browse files Browse the repository at this point in the history
Create a workflow for testing generated devcontainer setup
  • Loading branch information
rafaelfranca authored Apr 12, 2024
2 parents d8ca552 + 6fb1772 commit c23f7ae
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/devcontainer-smoke-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Devcontainer smoke test

on: [push, pull_request]

jobs:
build:
name: Devcontainer smoke test

runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
DATABASE:
- sqlite3
- postgresql
- mysql
- trilogy

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

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Ruby 3.3
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true

- name: Generate rails app
run: bundle exec railties/exe/rails new myapp --database="${{ matrix.DATABASE }}" --dev

- name: Test devcontainer
uses: devcontainers/ci@v0.3
with:
subFolder: myapp
imageName: ghcr.io/rails/smoke-test-devcontainer
cacheFrom: ghcr.io/rails/smoke-test-devcontainer
imageTag: ${{ matrix.DATABASE }}
refFilterForPush: refs/heads/main
runCmd: bin/rails g scaffold Post && bin/rails db:migrate && bin/rails test

0 comments on commit c23f7ae

Please sign in to comment.