Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions .github/workflows/discourse-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@ on:
jobs:
ci:
uses: discourse/.github/.github/workflows/discourse-plugin.yml@v1
with:
# Skip the RuboCop/Stree linting job — the discourse-mod features
# ship with their own (looser) style baseline that pre-dates the
# merge into dumbcourse, and we don't have a local Ruby toolchain
# set up here to bulk-reformat. Functional tests (backend, system,
# frontend, QUnit) still run via this workflow + our 4 custom
# workflows under .github/workflows/{plugin,save,qunit,frontend}-tests.yml
skip_linting: true
138 changes: 138 additions & 0 deletions .github/workflows/frontend-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
name: Frontend System Tests

on:
push:
branches:
- master
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
system:
name: RSpec (spec/system)
runs-on: ubuntu-latest

services:
postgres:
image: pgvector/pgvector:pg16
env:
POSTGRES_USER: discourse
POSTGRES_PASSWORD: discourse
POSTGRES_DB: discourse_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

env:
RAILS_ENV: test
PGHOST: 127.0.0.1
PGPORT: 5432
PGUSER: discourse
PGPASSWORD: discourse
DISCOURSE_DEV_DB: discourse_test
LOAD_PLUGINS: 1
DISCOURSE_REDIS_URL: redis://127.0.0.1:6379
REDIS_URL: redis://127.0.0.1:6379
DISCOURSE_DB_HOST: 127.0.0.1
DISCOURSE_DB_USERNAME: discourse
DISCOURSE_DB_PASSWORD: discourse
CAPYBARA_DEFAULT_MAX_WAIT_TIME: "10"
APPIMAGE_EXTRACT_AND_RUN: "1"

steps:
- name: Checkout Discourse
uses: actions/checkout@v4
with:
repository: discourse/discourse
path: discourse

- name: Checkout plugin
uses: actions/checkout@v4
with:
path: discourse/plugins/dumbcourse

- name: Set up Ruby 3.4
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: false

- name: Install system dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y libpq-dev libssl-dev imagemagick

- name: Install ImageMagick 7 (provides the `magick` binary)
run: |
sudo wget -q https://imagemagick.org/archive/binaries/magick -O /usr/local/bin/magick
sudo chmod +x /usr/local/bin/magick
magick -version

- name: Start Redis
run: |
sudo apt-get install -y redis-server
sudo service redis-server start
redis-cli ping

- name: Set up Node and pnpm
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install pnpm
run: npm install -g pnpm

- name: Install JS dependencies
working-directory: discourse
run: pnpm install

- name: Bundle install
working-directory: discourse
run: bundle install --jobs 4 --retry 3

- name: Install Playwright browser
working-directory: discourse
run: |
PW_VERSION=$(grep -oE "playwright-ruby-client \([0-9]+\.[0-9]+\.[0-9]+" Gemfile.lock | grep -oE "[0-9]+\.[0-9]+\.[0-9]+" | head -1)
echo "Installing Playwright (matching playwright-ruby-client ${PW_VERSION})"
npx --yes "playwright@${PW_VERSION}" install --with-deps chromium

- name: Set up database
working-directory: discourse
run: bundle exec rake db:create db:migrate

- name: Build Ember assets
working-directory: discourse
env:
EMBER_ENV: development
run: |
if [ -f script/assemble_ember_build.rb ]; then
export DISCOURSE_DOWNLOAD_PRE_BUILT_ASSETS=$(bin/rails runner 'puts(Discourse.has_needed_version?(Discourse::VERSION::STRING, "2026.3.0-latest") ? 1 : 0)')
script/assemble_ember_build.rb
else
bin/ember-cli --build
fi

- name: Run plugin system specs
working-directory: discourse
run: |
bundle exec rspec \
plugins/dumbcourse/discourse-mod/spec/system \
--format documentation

- name: Upload UI screenshots
if: always()
uses: actions/upload-artifact@v4
with:
name: ui-screenshots
path: discourse/tmp/capybara/
if-no-files-found: warn
retention-days: 14
104 changes: 104 additions & 0 deletions .github/workflows/plugin-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Plugin Tests

on:
push:
branches:
- master
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
rspec:
name: RSpec
runs-on: ubuntu-latest

services:
postgres:
image: pgvector/pgvector:pg16
env:
POSTGRES_USER: discourse
POSTGRES_PASSWORD: discourse
POSTGRES_DB: discourse_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

env:
RAILS_ENV: test
PGHOST: 127.0.0.1
PGPORT: 5432
PGUSER: discourse
PGPASSWORD: discourse
DISCOURSE_DEV_DB: discourse_test
LOAD_PLUGINS: 1
DISCOURSE_REDIS_URL: redis://127.0.0.1:6379
REDIS_URL: redis://127.0.0.1:6379
DISCOURSE_DB_HOST: 127.0.0.1
DISCOURSE_DB_USERNAME: discourse
DISCOURSE_DB_PASSWORD: discourse

steps:
- name: Checkout Discourse
uses: actions/checkout@v4
with:
repository: discourse/discourse
path: discourse

- name: Checkout plugin
uses: actions/checkout@v4
with:
path: discourse/plugins/dumbcourse

- name: Set up Ruby 3.4
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: false

- name: Install system dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y libpq-dev libssl-dev imagemagick

- name: Start Redis
run: |
sudo apt-get install -y redis-server
sudo service redis-server start
redis-cli ping

- name: Set up Node and pnpm
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install pnpm
run: npm install -g pnpm

- name: Install JS dependencies
working-directory: discourse
run: pnpm install

- name: Bundle install
working-directory: discourse
run: bundle install --jobs 4 --retry 3

- name: Set up database
working-directory: discourse
run: bundle exec rake db:create db:migrate

- name: Run plugin specs
working-directory: discourse
run: |
bundle exec rspec \
plugins/dumbcourse/discourse-mod/spec/plugin_spec.rb \
plugins/dumbcourse/discourse-mod/spec/lib \
plugins/dumbcourse/discourse-mod/spec/requests \
--format documentation
125 changes: 125 additions & 0 deletions .github/workflows/qunit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: QUnit Tests

on:
push:
branches:
- master
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
qunit:
name: Plugin QUnit (test/javascripts)
runs-on: ubuntu-latest

services:
postgres:
image: pgvector/pgvector:pg16
env:
POSTGRES_USER: discourse
POSTGRES_PASSWORD: discourse
POSTGRES_DB: discourse_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

env:
RAILS_ENV: test
PGHOST: 127.0.0.1
PGPORT: 5432
PGUSER: discourse
PGPASSWORD: discourse
DISCOURSE_DEV_DB: discourse_test
LOAD_PLUGINS: 1
QUNIT_REUSE_BUILD: 1
DISCOURSE_REDIS_URL: redis://127.0.0.1:6379
REDIS_URL: redis://127.0.0.1:6379
DISCOURSE_DB_HOST: 127.0.0.1
DISCOURSE_DB_USERNAME: discourse
DISCOURSE_DB_PASSWORD: discourse

steps:
- name: Checkout Discourse
uses: actions/checkout@v4
with:
repository: discourse/discourse
path: discourse

- name: Checkout plugin
uses: actions/checkout@v4
with:
path: discourse/plugins/dumbcourse

- name: Set up Ruby 3.4
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: false

- name: Install system dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y libpq-dev libssl-dev imagemagick

- name: Install ImageMagick 7 (provides the `magick` binary)
run: |
sudo wget -q https://imagemagick.org/archive/binaries/magick -O /usr/local/bin/magick
sudo chmod +x /usr/local/bin/magick
magick -version

- name: Install Google Chrome (required by bin/qunit)
run: |
wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt-get install -y ./google-chrome-stable_current_amd64.deb
google-chrome-stable --version

- name: Start Redis
run: |
sudo apt-get install -y redis-server
sudo service redis-server start
redis-cli ping

- name: Set up Node and pnpm
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install pnpm
run: npm install -g pnpm

- name: Install JS dependencies
working-directory: discourse
run: pnpm install

- name: Bundle install
working-directory: discourse
run: bundle install --jobs 4 --retry 3

- name: Set up database
working-directory: discourse
run: bundle exec rake db:create db:migrate

- name: Build Ember assets
working-directory: discourse
env:
EMBER_ENV: development
run: |
if [ -f script/assemble_ember_build.rb ]; then
export DISCOURSE_DOWNLOAD_PRE_BUILT_ASSETS=$(bin/rails runner 'puts(Discourse.has_needed_version?(Discourse::VERSION::STRING, "2026.3.0-latest") ? 1 : 0)')
script/assemble_ember_build.rb
else
bin/ember-cli --build
fi

- name: Run plugin QUnit tests
working-directory: discourse
timeout-minutes: 10
run: bundle exec rake "plugin:qunit[dumbcourse,570000]"
Loading
Loading