mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 06:49:14 +08:00
f29b956339
Note this commit also slightly changes internal API: channel instead of getChannel and updateCurrentUserChannelNotificationsSettings instead of updateCurrentUserChatChannelNotificationsSettings. Also destroyChannel takes a second param which is the name confirmation instead of an optional object containing this confirmation. This is to enforce the fact that it's required. In the future a top level jsdoc config file could be used instead of the hack tempfile, but while it's only an experiment for chat, it's probably good enough.
77 lines
2.2 KiB
YAML
77 lines
2.2 KiB
YAML
name: Documentation
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build:
|
|
if: "!(github.event_name == 'push' && github.repository == 'discourse/discourse-private-mirror')"
|
|
name: run
|
|
runs-on: ubuntu-latest
|
|
container: discourse/discourse_test:slim
|
|
timeout-minutes: 30
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Setup Git
|
|
run: |
|
|
git config --global user.email "ci@ci.invalid"
|
|
git config --global user.name "Discourse CI"
|
|
|
|
- name: Bundler cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: vendor/bundle
|
|
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gem-
|
|
|
|
- name: Setup gems
|
|
run: |
|
|
gem install bundler --conservative -v $(awk '/BUNDLED WITH/ { getline; gsub(/ /,""); print $0 }' Gemfile.lock)
|
|
bundle config --local path vendor/bundle
|
|
bundle config --local deployment true
|
|
bundle config --local without development
|
|
bundle install --jobs 4
|
|
bundle clean
|
|
|
|
- name: Get yarn cache directory
|
|
id: yarn-cache-dir
|
|
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Yarn cache
|
|
uses: actions/cache@v3
|
|
id: yarn-cache
|
|
with:
|
|
path: ${{ steps.yarn-cache-dir.outputs.dir }}
|
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-yarn-
|
|
|
|
- name: Yarn install
|
|
run: yarn install
|
|
|
|
- name: Check Chat documentation
|
|
run: |
|
|
LOAD_PLUGINS=1 bin/rake chat:doc
|
|
|
|
if [ ! -z "$(git status --porcelain plugins/chat/docs/)" ]; then
|
|
echo "Chat documentation is not up to date. To resolve, run:"
|
|
echo " LOAD_PLUGINS=1 bin/rake chat:doc"
|
|
echo
|
|
echo "Or manually apply the diff printed below:"
|
|
echo "---------------------------------------------"
|
|
git -c color.ui=always diff plugins/chat/docs/
|
|
exit 1
|
|
fi
|
|
timeout-minutes: 30
|