Skip to content

Commit

Permalink
Merge branch 'dev' into pr/joplin-server-debug-report
Browse files Browse the repository at this point in the history
  • Loading branch information
personalizedrefrigerator authored Nov 25, 2023
2 parents f4dcbbf + 6244999 commit f864283
Show file tree
Hide file tree
Showing 11 changed files with 125 additions and 88 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
9 changes: 9 additions & 0 deletions .github/workflows/check-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Check pull request title
on: [pull_request]
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: Slashgear/[email protected]
with:
regexp: "(Desktop|Mobile|All|Cli|Tools|Chore|Clipper|Server|Android|iOS|Plugins|CI|Plugin Repo|Doc): (Fixes|Resolves) #[0-9]+: .+"
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/[email protected]
4 changes: 2 additions & 2 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.8",
"@types/react": "18.2.33",
"@types/react": "18.2.34",
"@types/react-redux": "7.1.28",
"@types/styled-components": "5.1.29",
"electron": "26.5.0",
Expand Down
4 changes: 2 additions & 2 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 Down Expand Up @@ -95,7 +95,7 @@
"@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
42 changes: 20 additions & 22 deletions packages/doc-builder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,38 @@

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

### Installation
## Development

```
$ yarn
```
### Generating the MDX files

### Local Development
From `packages/tools`, run `node website/processDocs.js --env dev`

```
$ yarn start
### Getting the translations

```shell
CROWDIN_PERSONAL_TOKEN=..... yarn crowdinDownload
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
### Building the doc

### Build
From `packages/doc-builder`, run:

```
$ yarn build
```shell
WEBSITE_BASE_URL=http://localhost:8077 yarn buildDev
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.
Or to build a particular locale:

### Deployment
```shell
WEBSITE_BASE_URL=http://localhost:8077 yarn buildDev --locale fr
```

Using SSH:
`processDocs.js` will also build everything by default, but it takes a long time, so using the above commands is convenient for dev.

```
$ USE_SSH=true yarn deploy
```
## Translation

Not using SSH:
Translation is done using https://crowdin.com/

```
$ GIT_USER=<Your GitHub username> yarn deploy
```
## Building for production

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
This is done in `release-website.sh` from the repository https://github.com/joplin/website/
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/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@types/js-yaml": "4.0.8",
"@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/tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading

0 comments on commit f864283

Please sign in to comment.