Skip to content

Don't add bin/rubocop if rubocop is not in Gemfile #8

Don't add bin/rubocop if rubocop is not in Gemfile

Don't add bin/rubocop if rubocop is not in Gemfile #8

name: Devcontainer smoke test
on: push
jobs:
build:
name: Devcontainer smoke test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
steps:
- name: Checkout (GitHub)
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
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 sqlite3
run: bundle exec railties/exe/rails new myapp_sqlite --database="sqlite3" --dev --devcontainer
- name: Test devcontainer sqlite3
uses: devcontainers/[email protected]
with:
subFolder: myapp_sqlite
imageName: ghcr.io/rails/smoke-test-devcontainer
cacheFrom: ghcr.io/rails/smoke-test-devcontainer
imageTag: sqlite3
push: ${{ github.repository_owner == 'rails' && 'filter' || 'never' }}
refFilterForPush: refs/heads/main
runCmd: bin/rails g scaffold Post && bin/rails db:migrate && bin/rails test
- name: Stop all containers
run: docker ps -q | xargs docker stop
- name: Generate rails app postgresql
run: bundle exec railties/exe/rails new myapp_postgresql --database="postgresql" --dev --devcontainer
- name: Test devcontainer postgresql
uses: devcontainers/[email protected]
with:
subFolder: myapp_postgresql
imageName: ghcr.io/rails/smoke-test-devcontainer
cacheFrom: ghcr.io/rails/smoke-test-devcontainer
imageTag: postgresql
push: ${{ github.repository_owner == 'rails' && 'filter' || 'never' }}
refFilterForPush: refs/heads/main
runCmd: bin/rails g scaffold Post && bin/rails db:migrate && bin/rails test && bin/rails test:system
- name: Stop all containers
run: docker ps -q | xargs docker stop
- name: Generate rails app mysql
run: bundle exec railties/exe/rails new myapp_mysql --database="mysql" --dev --devcontainer
- name: Test devcontainer mysql
uses: devcontainers/[email protected]
with:
subFolder: myapp_mysql
imageName: ghcr.io/rails/smoke-test-devcontainer
cacheFrom: ghcr.io/rails/smoke-test-devcontainer
imageTag: mysql
push: ${{ github.repository_owner == 'rails' && 'filter' || 'never' }}
refFilterForPush: refs/heads/main
runCmd: bin/rails g scaffold Post && bin/rails db:migrate && bin/rails test
- name: Stop all containers
run: docker ps -q | xargs docker stop
- name: Generate rails app trilogy
run: bundle exec railties/exe/rails new myapp_trilogy --database="trilogy" --dev --devcontainer
- name: Test devcontainer trilogy
uses: devcontainers/[email protected]
with:
subFolder: myapp_trilogy
imageName: ghcr.io/rails/smoke-test-devcontainer
cacheFrom: ghcr.io/rails/smoke-test-devcontainer
imageTag: trilogy
push: ${{ github.repository_owner == 'rails' && 'filter' || 'never' }}
refFilterForPush: refs/heads/main
runCmd: bin/rails g scaffold Post && bin/rails db:migrate && bin/rails test
- name: Stop all containers
run: docker ps -q | xargs docker stop