diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index a29b31a045..0000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,49 +0,0 @@ -version: 2.1 - -executors: - docker: - working_directory: /tmp/workspace - docker: - - image: docker:latest - -jobs: - docker: - parameters: - with_deploy: - type: boolean - default: false - executor: docker - steps: - - checkout - - setup_remote_docker: - version: 19.03.13 - - run: - name: Build - command: | - docker build -t misskey/misskey . - - when: - condition: <> - steps: - - run: - name: Deploy - command: | - if [ "$DOCKERHUB_USERNAME$DOCKERHUB_PASSWORD" ] - then - apk update && apk add jq - docker tag misskey/misskey misskey/misskey:$(cat package.json | jq -r .version) - docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD - docker push -a misskey/misskey - else - echo -e '\033[0;33mAborted deploying to Docker Hub\033[0;39m' - fi - -workflows: - version: 2 - docker: - jobs: - - docker: - name: auto-build - with_deploy: true - filters: - branches: - only: master diff --git a/.circleci/misskey/default.yml b/.circleci/misskey/default.yml deleted file mode 100644 index ae18a841bd..0000000000 --- a/.circleci/misskey/default.yml +++ /dev/null @@ -1,12 +0,0 @@ -url: 'http://misskey.local' -port: 8080 -db: - host: localhost - port: 5432 - db: test-misskey - user: postgres - pass: '' -redis: - host: localhost - port: 6379 -id: aid diff --git a/.circleci/misskey/test.yml b/.github/misskey/test.yml similarity index 100% rename from .circleci/misskey/test.yml rename to .github/misskey/test.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000000..0b3bbc186f --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,21 @@ +name: Lint + +on: + push: + branches: + - master + - develop + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - uses: actions/setup-node@v1 + with: + node-version: 12.x + - run: yarn install + - run: yarn lint diff --git a/.github/workflows/nodejs.yml b/.github/workflows/test.yml similarity index 55% rename from .github/workflows/nodejs.yml rename to .github/workflows/test.yml index a91572ad78..045d209802 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,5 @@ -name: Node.js CI +name: Test + on: push: branches: @@ -7,12 +8,12 @@ on: pull_request: jobs: - build_and_test: + mocha: runs-on: ubuntu-latest strategy: matrix: - node-version: [14.x, 16.x] + node-version: [16.x] services: postgres: @@ -44,16 +45,43 @@ jobs: - name: Build run: yarn build - name: Test - run: yarn test + run: yarn mocha - lint: + e2e: runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x] + + services: + postgres: + image: postgres:12.2-alpine + ports: + - 54312:5432 + env: + POSTGRES_DB: test-misskey + POSTGRES_HOST_AUTH_METHOD: trust + redis: + image: redis:4.0-alpine + ports: + - 56312:6379 + steps: - uses: actions/checkout@v2 with: submodules: true - - uses: actions/setup-node@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 with: - node-version: 12.x - - run: yarn install - - run: yarn lint + node-version: ${{ matrix.node-version }} + - name: Install dependencies + run: yarn install + - name: Check yarn.lock + run: git diff --exit-code yarn.lock + - name: Copy Configure + run: cp test/test.yml .config + - name: Build + run: yarn build + - name: Test + run: yarn e2e diff --git a/cypress.json b/cypress.json index f2c02689e4..e858e480b0 100644 --- a/cypress.json +++ b/cypress.json @@ -1,3 +1,3 @@ { - "baseUrl": "http://localhost" + "baseUrl": "http://localhost:61812" } diff --git a/package.json b/package.json index f0bdd0049d..94cdb1a6cf 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,9 @@ "lint": "tslint 'src/**/*.ts'", "cy:open": "cypress open", "cy:run": "cypress run", - "e2e": "start-server-and-test start:test http://localhost cy:run", - "test": "cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=\"./test/tsconfig.json\" mocha", + "e2e": "start-server-and-test start:test http://localhost:61812 cy:run", + "mocha": "cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=\"./test/tsconfig.json\" mocha", + "test": "npm run mocha", "format": "gulp format" }, "resolutions": { diff --git a/src/client/components/google.vue b/src/client/components/google.vue index 6d8ae0b5bf..be724f038d 100644 --- a/src/client/components/google.vue +++ b/src/client/components/google.vue @@ -10,7 +10,12 @@ import { defineComponent } from 'vue'; import * as os from '@client/os'; export default defineComponent({ - props: ['q'], + props: { + q: { + type: String, + required: true, + } + }, data() { return { query: null, @@ -21,10 +26,7 @@ export default defineComponent({ }, methods: { search() { - const engine = this.$store.state.webSearchEngine || - 'https://www.google.com/search?q={{query}}'; - const url = engine.replace('{{query}}', this.query) - window.open(url, '_blank'); + window.open(`https://www.google.com/search?q=${this.query}`, '_blank'); } } }); diff --git a/src/client/ui/_common_/sidebar.vue b/src/client/ui/_common_/sidebar.vue index ece80e60d9..cd78b6ae46 100644 --- a/src/client/ui/_common_/sidebar.vue +++ b/src/client/ui/_common_/sidebar.vue @@ -35,7 +35,7 @@ {{ $ts.settings }} -