DEV: Update CI workflows (#38)
Co-authored-by: discoursebuild <build@discourse.org>
This commit is contained in:
parent
015defed7c
commit
3d20217880
|
@ -20,18 +20,18 @@ jobs:
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 18
|
||||||
cache: yarn
|
cache: yarn
|
||||||
|
|
||||||
- name: Yarn install
|
- name: Yarn install
|
||||||
run: yarn install
|
run: yarn install
|
||||||
|
|
||||||
- name: ESLint
|
- name: ESLint
|
||||||
if: ${{ always() }}
|
if: ${{ !cancelled() }}
|
||||||
run: yarn eslint --ext .js,.js.es6 --no-error-on-unmatched-pattern {test,javascripts}
|
run: yarn eslint --ext .js,.js.es6 --no-error-on-unmatched-pattern {test,javascripts}
|
||||||
|
|
||||||
- name: Prettier
|
- name: Prettier
|
||||||
if: ${{ always() }}
|
if: ${{ !cancelled() }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
yarn prettier -v
|
yarn prettier -v
|
||||||
|
@ -44,5 +44,5 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Ember template lint
|
- name: Ember template lint
|
||||||
if: ${{ always() }}
|
if: ${{ !cancelled() }}
|
||||||
run: yarn ember-template-lint --no-error-on-unmatched-pattern javascripts
|
run: yarn ember-template-lint --no-error-on-unmatched-pattern javascripts
|
||||||
|
|
|
@ -28,7 +28,7 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if [ 0 -lt $(find tmp/component/test -type f \( -name "*.js" -or -name "*.es6" \) 2> /dev/null | wc -l) ]; then
|
if [ 0 -lt $(find tmp/component/test -type f \( -name "*.js" -or -name "*.es6" \) 2> /dev/null | wc -l) ]; then
|
||||||
echo "::set-output name=tests_exist::true"
|
echo "tests_exist=true" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
test:
|
test:
|
||||||
|
@ -94,7 +94,7 @@ jobs:
|
||||||
|
|
||||||
- name: Get yarn cache directory
|
- name: Get yarn cache directory
|
||||||
id: yarn-cache-dir
|
id: yarn-cache-dir
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Yarn cache
|
- name: Yarn cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -139,9 +139,14 @@ jobs:
|
||||||
if: steps.app-cache.outputs.cache-hit != 'true'
|
if: steps.app-cache.outputs.cache-hit != 'true'
|
||||||
run: rm -rf tmp/app-cache/uploads && cp -r public/uploads tmp/app-cache/uploads
|
run: rm -rf tmp/app-cache/uploads && cp -r public/uploads tmp/app-cache/uploads
|
||||||
|
|
||||||
|
- name: Create theme archive
|
||||||
|
run: |
|
||||||
|
cd tmp/component
|
||||||
|
git archive --format=tar.gz HEAD > ../../theme.tar.gz
|
||||||
|
|
||||||
- name: Component QUnit
|
- name: Component QUnit
|
||||||
run: |
|
run: |
|
||||||
THEME_NAME=$(ruby -e 'require "json"; puts JSON.parse(File.read("tmp/component/about.json"))["name"]')
|
THEME_NAME=$(ruby -e 'require "json"; puts JSON.parse(File.read("tmp/component/about.json"))["name"]')
|
||||||
bundle exec rake themes:install -- "--{\"$THEME_NAME\": \"tmp/component\"}"
|
THEME_ARCHIVE=theme.tar.gz bundle exec rake themes:install:archive
|
||||||
UNICORN_TIMEOUT=120 bundle exec rake "themes:qunit[name,$THEME_NAME]"
|
UNICORN_TIMEOUT=120 bundle exec rake "themes:qunit[name,$THEME_NAME]"
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
|
|
Loading…
Reference in New Issue