Skip to content

Commit

Permalink
Merge branch 'dev' into check-pr-title
Browse files Browse the repository at this point in the history
  • Loading branch information
laurent22 authored Nov 24, 2023
2 parents d9ce98d + 84cc157 commit 60c755d
Show file tree
Hide file tree
Showing 15 changed files with 147 additions and 110 deletions.
42 changes: 29 additions & 13 deletions .github/scripts/run_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,23 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
ROOT_DIR="$SCRIPT_DIR/../.."

IS_PULL_REQUEST=0
IS_DEV_BRANCH=0
IS_DESKTOP_RELEASE=0
IS_SERVER_RELEASE=0
IS_LINUX=0
IS_MACOS=0

# If pull requests are coming from a branch of the main repository,
# IS_PULL_REQUEST will be zero.
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
IS_PULL_REQUEST=1
fi

if [ "$GITHUB_REF" == "refs/heads/dev" ]; then
IS_DEV_BRANCH=1
if [[ $GIT_TAG_NAME = $SERVER_TAG_PREFIX-* ]]; then
IS_SERVER_RELEASE=1
fi

if [[ $GIT_TAG_NAME = v* ]]; then
IS_DESKTOP_RELEASE=1
fi

if [ "$RUNNER_OS" == "Linux" ]; then
Expand All @@ -28,6 +35,14 @@ else
IS_MACOS=1
fi

# Tests can randomly fail in some cases, so only run them when not publishing
# a release
RUN_TESTS=0

if [ "$IS_SERVER_RELEASE" = 0 ] && [ "$IS_DESKTOP_RELEASE" = 0 ]; then
RUN_TESTS=1
fi

# =============================================================================
# Print environment
# =============================================================================
Expand All @@ -43,7 +58,9 @@ echo "SERVER_TAG_PREFIX=$SERVER_TAG_PREFIX"

echo "IS_CONTINUOUS_INTEGRATION=$IS_CONTINUOUS_INTEGRATION"
echo "IS_PULL_REQUEST=$IS_PULL_REQUEST"
echo "IS_DEV_BRANCH=$IS_DEV_BRANCH"
echo "IS_DESKTOP_RELEASE=$IS_DESKTOP_RELEASE"
echo "IS_SERVER_RELEASE=$IS_SERVER_RELEASE"
echo "RUN_TESTS=$RUN_TESTS"
echo "IS_LINUX=$IS_LINUX"
echo "IS_MACOS=$IS_MACOS"

Expand All @@ -64,11 +81,10 @@ if [ $testResult -ne 0 ]; then
fi

# =============================================================================
# Run test units. Only do it for pull requests and dev branch because we don't
# want it to randomly fail when trying to create a desktop release.
# Run test units
# =============================================================================

if [ "$IS_PULL_REQUEST" == "1" ] || [ "$IS_DEV_BRANCH" = "1" ]; then
if [ "$RUN_TESTS" == "1" ]; then
echo "Step: Running tests..."

# On Linux, we run the Joplin Server tests using PostgreSQL
Expand Down Expand Up @@ -102,7 +118,7 @@ fi
# Check that the website builder can run without errors
# =============================================================================

if [ "$IS_PULL_REQUEST" == "1" ] || [ "$IS_DEV_BRANCH" = "1" ]; then
if [ "$RUN_TESTS" == "1" ]; then
if [ "$IS_LINUX" == "1" ]; then
echo "Step: Running website builder..."
node packages/tools/website/processDocs.js --env dev
Expand All @@ -114,7 +130,7 @@ fi
# release randomly fail.
# =============================================================================

if [ "$IS_PULL_REQUEST" == "1" ] || [ "$IS_DEV_BRANCH" = "1" ]; then
if [ "$RUN_TESTS" == "1" ]; then
echo "Step: Running linter..."

yarn run linter-ci ./
Expand Down Expand Up @@ -154,7 +170,7 @@ fi
# what commit may have broken translation building.
# =============================================================================

if [ "$IS_PULL_REQUEST" == "1" ] || [ "$IS_DEV_BRANCH" = "1" ]; then
if [ "$RUN_TESTS" == "1" ]; then
if [ "$IS_LINUX" == "1" ]; then
echo "Step: Checking for lost translation strings..."

Expand Down Expand Up @@ -190,7 +206,7 @@ fi
# Check that the website still builds
# =============================================================================

if [ "$IS_PULL_REQUEST" == "1" ] || [ "$IS_DEV_BRANCH" = "1" ]; then
if [ "$RUN_TESTS" == "1" ]; then
echo "Step: Check that the website still builds..."

mkdir -p ../joplin-website/docs
Expand Down Expand Up @@ -226,7 +242,7 @@ fi

cd "$ROOT_DIR/packages/app-desktop"

if [[ $GIT_TAG_NAME = v* ]]; then
if [ "$IS_DESKTOP_RELEASE" == "1" ]; then
echo "Step: Building and publishing desktop application..."
# cd "$ROOT_DIR/packages/tools"
# node bundleDefaultPlugins.js
Expand All @@ -251,7 +267,7 @@ if [[ $GIT_TAG_NAME = v* ]]; then
else
USE_HARD_LINKS=false yarn run dist
fi
elif [[ $IS_LINUX = 1 ]] && [[ $GIT_TAG_NAME = $SERVER_TAG_PREFIX-* ]]; then
elif [[ $IS_LINUX = 1 ]] && [ "$IS_SERVER_RELEASE" == "1" ]; then
echo "Step: Building Docker Image..."
cd "$ROOT_DIR"
yarn run buildServerDocker --tag-name $GIT_TAG_NAME --push-images --repository $SERVER_REPOSITORY
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/comment-on-failure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: comment-on-failure
on:
workflow_run:
workflows:
- Joplin Continuous Integration
- react-native-android-build-apk
- Build macOS M1
types: [ completed ]

jobs:
comment-failure:
runs-on: ubuntu-latest
steps:
- uses: quipper/comment-failure-action@v0.1.1
2 changes: 1 addition & 1 deletion packages/app-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"@joplin/tools": "~2.13",
"@types/fs-extra": "11.0.3",
"@types/jest": "29.5.5",
"@types/node": "18.18.7",
"@types/node": "18.18.8",
"@types/proper-lockfile": "^4.1.2",
"gulp": "4.0.2",
"jest": "29.7.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/app-desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@
"devDependencies": {
"@electron/rebuild": "3.3.0",
"@joplin/tools": "~2.13",
"@playwright/test": "1.38.1",
"@playwright/test": "1.39.0",
"@testing-library/react-hooks": "8.0.1",
"@types/jest": "29.5.5",
"@types/node": "18.18.7",
"@types/react": "18.2.33",
"@types/node": "18.18.8",
"@types/react": "18.2.34",
"@types/react-redux": "7.1.28",
"@types/styled-components": "5.1.29",
"electron": "26.5.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/app-mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@react-native-community/clipboard": "1.5.1",
"@react-native-community/datetimepicker": "7.6.1",
"@react-native-community/geolocation": "3.1.0",
"@react-native-community/netinfo": "9.4.1",
"@react-native-community/netinfo": "9.4.2",
"@react-native-community/push-notification-ios": "1.11.0",
"@react-native-community/slider": "4.4.3",
"assert-browserify": "2.0.0",
Expand All @@ -42,7 +42,7 @@
"md5": "2.3.0",
"path-browserify": "1.0.1",
"prop-types": "15.8.1",
"punycode": "2.3.0",
"punycode": "2.3.1",
"react": "18.2.0",
"react-native": "0.71.10",
"react-native-camera": "4.2.1",
Expand Down Expand Up @@ -91,11 +91,11 @@
"@js-draw/material-icons": "1.11.2",
"@lezer/highlight": "1.1.4",
"@testing-library/jest-native": "5.4.3",
"@testing-library/react-native": "12.3.1",
"@testing-library/react-native": "12.3.2",
"@tsconfig/react-native": "2.0.2",
"@types/fs-extra": "11.0.3",
"@types/jest": "29.5.5",
"@types/react": "18.2.33",
"@types/react": "18.2.34",
"@types/react-native": "0.70.6",
"@types/react-redux": "7.1.28",
"@types/tar-stream": "2.2.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@joplin/lib": "~2.13",
"@testing-library/react-hooks": "8.0.1",
"@types/jest": "29.5.5",
"@types/react": "18.2.33",
"@types/react": "18.2.34",
"@types/react-redux": "7.1.28",
"@types/styled-components": "5.1.29",
"jest": "29.7.0",
Expand All @@ -26,7 +26,7 @@
"typescript": "5.2.2"
},
"dependencies": {
"@codemirror/autocomplete": "6.9.2",
"@codemirror/autocomplete": "6.10.2",
"@codemirror/commands": "6.2.5",
"@codemirror/lang-cpp": "6.0.2",
"@codemirror/lang-html": "6.4.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/fork-htmlparser2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"devDependencies": {
"@types/jest": "29.5.5",
"@types/node": "18.18.7",
"@types/node": "18.18.8",
"@typescript-eslint/eslint-plugin": "6.7.2",
"@typescript-eslint/parser": "6.7.2",
"coveralls": "3.1.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"@types/fs-extra": "11.0.3",
"@types/jest": "29.5.5",
"@types/js-yaml": "4.0.8",
"@types/node": "18.18.7",
"@types/node": "18.18.8",
"@types/node-rsa": "1.1.3",
"@types/react": "18.2.33",
"@types/react": "18.2.34",
"@types/uuid": "9.0.6",
"clean-html": "1.5.0",
"jest": "29.7.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/pdf-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"devDependencies": {
"@types/jest": "29.5.5",
"@types/pdfjs-dist": "2.10.378",
"@types/react": "18.2.33",
"@types/react": "18.2.34",
"@types/react-dom": "18.2.14",
"@types/styled-components": "5.1.29",
"babel-jest": "29.7.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-repo-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"devDependencies": {
"@types/fs-extra": "11.0.3",
"@types/jest": "29.5.5",
"@types/node": "18.18.7",
"@types/node": "18.18.8",
"jest": "29.7.0",
"source-map-loader": "4.0.1",
"typescript": "5.2.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"devDependencies": {
"@types/jest": "29.5.5",
"@types/markdown-it": "13.0.5",
"@types/node": "18.18.7",
"@types/node": "18.18.8",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"ts-jest": "29.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"pretty-bytes": "5.6.0",
"prettycron": "0.10.0",
"query-string": "7.1.3",
"rate-limiter-flexible": "3.0.0",
"rate-limiter-flexible": "3.0.3",
"raw-body": "2.5.2",
"sqlite3": "5.1.6",
"stripe": "8.222.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
"@types/js-yaml": "4.0.8",
"@types/markdown-it": "13.0.5",
"@types/mustache": "4.2.4",
"@types/node": "18.18.7",
"@types/node-fetch": "2.6.7",
"@types/node": "18.18.8",
"@types/node-fetch": "2.6.8",
"@types/yargs": "17.0.29",
"gettext-extractor": "3.8.0",
"gulp": "4.0.2",
Expand All @@ -61,7 +61,7 @@
"rss": "1.2.2",
"sass": "1.69.5",
"sqlite3": "5.1.6",
"style-to-js": "1.1.8",
"style-to-js": "1.1.9",
"typescript": "5.2.2"
},
"gitHead": "05a29b450962bf05a8642bbd39446a1f679a96ba"
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"devDependencies": {
"@types/fs-extra": "11.0.3",
"@types/jest": "29.5.5",
"@types/node-fetch": "2.6.7",
"@types/node-fetch": "2.6.8",
"jest": "29.7.0",
"ts-jest": "29.1.1"
},
Expand Down
Loading

0 comments on commit 60c755d

Please sign in to comment.