diff options
-rw-r--r-- | .circleci/config.yml | 125 | ||||
-rw-r--r-- | .github/workflows/build.yaml | 106 | ||||
-rw-r--r-- | package.json | 6 | ||||
-rw-r--r-- | yarn.lock | 98 |
4 files changed, 122 insertions, 213 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 22dbcfc..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,125 +0,0 @@ -version: 2.1 - -executors: - default: - docker: - - image: circleci/node:14.15.1-stretch-browsers - environment: - - FIREFOX_VERSION: "78.3.0esr" - - GECKODRIVER_VERSION: "0.27.0" - working_directory: ~ - -commands: - install_firefox: - steps: - - restore_cache: - key: firefox-bin - paths: - - ~/firefox - - run: - name: Install Firefox - command: | - test -d ~/firefox/${FIREFOX_VERSION} && exit 0 - url=https://ftp.mozilla.org/pub/firefox/releases/${FIREFOX_VERSION}/linux-x86_64/en-US/firefox-${FIREFOX_VERSION}.tar.bz2 - curl -sSL -o- "$url" | tar xvfj - - mkdir -p ~/firefox - mv firefox ~/firefox/${FIREFOX_VERSION} - - save_cache: - key: firefox-bin - paths: - - ~/firefox - - run: echo 'export PATH=~/firefox/$FIREFOX_VERSION:$PATH' >> $BASH_ENV - - install_geckodriver: - steps: - - run: - name: Install geckodriver - command: | - mkdir -p geckodriver - - url=https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v${GECKODRIVER_VERSION}-linux64.tar.gz - curl -sSLf "$url" | tar -C geckodriver xvf - - - echo 'export PATH=~/geckodriver/$GECKODRIVER_VERSION:$PATH' >> $BASH_ENV - - install_dependencies: - steps: - - restore_cache: - keys: - - yarn-packages-{{ checksum "yarn.lock" }} - - run: - name: Install dependencies - command: yarn install - - save_cache: - key: yarn-packages-{{ checksum "yarn.lock" }} - paths: - - ~/.cache/yarn - -jobs: - build: - executor: - name: default - steps: - - install_firefox - - checkout - - install_dependencies - - run: yarn lint - - run: yarn test - - run: yarn package - - e2e: - executor: - name: default - steps: - - run: sudo apt-get update && sudo apt-get -y install xsel - - install_firefox - - checkout - - install_dependencies - - run: yarn build - - run: yarn test:e2e - - deploy: - executor: - name: default - steps: - - checkout - - install_dependencies - - run: yarn package - - run: - name: Deploy to AMO - command: | - version=$(jq -r '.version' manifest.json) - ./script/deploy vim-vixen@i-beam.org "$version" "vim-vixen-${version}.zip" - -workflows: - version: 2 - build_and_test: - jobs: - - build - - e2e: - filters: - branches: - ignore: /^greenkeeper\/.*/ - deploy: - jobs: - - build: - filters: - tags: - only: /^.*/ - branches: - ignore: /.*/ - - e2e: - filters: - tags: - only: /^.*/ - branches: - ignore: /.*/ - - deploy: - requires: - - build - - e2e - filters: - tags: - only: /^.*/ - branches: - ignore: /.*/ diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..1c2fc62 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,106 @@ +name: Build + +on: + push: + branches: + - "*" + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '14.15.1' + - uses: ueokande/setup-firefox@latest + with: + firefox-version: 78.3.0esr + - uses: ueokande/setup-geckodriver@latest + with: + geckodriver-version: 0.28.0 + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - run: yarn install + - run: yarn lint + - run: yarn test + - run: yarn package + + test-e2e: + name: E2E Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '14.15.1' + - uses: ueokande/setup-firefox@latest + with: + firefox-version: 78.3.0esr + - uses: ueokande/setup-geckodriver@latest + with: + geckodriver-version: 0.28.0 + - name: Install xsel + run: sudo apt-get install -y --no-install-recommends xsel + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - run: yarn install + - run: yarn build + - name: Run test + run: | + export DISPLAY=:99 + + geckodriver & + sudo Xvfb -ac :99 -screen 0 1280x1024x24 >/dev/null 2>&1 & + + yarn test:e2e + + deploy: + name: Release to AMO + needs: [build, test-e2e] + if: startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '14.15.1' + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - run: yarn install + - run: yarn package + - name: Release to AMO + env: + JWT_ISSUER: "${{ secrets.JWT_ISSUER }}" + JWT_SECRET: "${{ secrets.JWT_SECRET }}" + run: | + version=$(jq -r '.version' manifest.json) + ./script/deploy vim-vixen@i-beam.org "$version" "vim-vixen-${version}.zip" diff --git a/package.json b/package.json index d4fcfb1..bff93e0 100644 --- a/package.json +++ b/package.json @@ -43,9 +43,9 @@ "ajv-cli": "^4.0.1", "chai": "^4.2.0", "css-loader": "^5.0.1", - "eslint": "7.15.0", + "eslint": "7.16.0", "eslint-config-prettier": "7.0.0", - "eslint-plugin-prettier": "3.1.4", + "eslint-plugin-prettier": "3.3.0", "eslint-plugin-react": "7.21.5", "eslint-plugin-standard": "^5.0.0", "express": "^4.17.1", @@ -65,7 +65,7 @@ "prettier": "2.2.1", "prettier-eslint": "12.0.0", "react": "16.14.0", - "react-dom": "16.13.1", + "react-dom": "16.14.0", "react-redux": "^7.1.3", "react-test-renderer": "16.13.1", "redux": "^4.0.5", @@ -293,9 +293,9 @@ integrity sha512-Jus9s4CDbqwocc5pOAnh8ShfrnMcPHuJYzVcSUU7lrh8Ni5HuIqX3oilL86p3dlTrk0LzHRCgA/GQ7uNCw6l2Q== "@types/mocha@^8.0.1": - version "8.0.4" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-8.0.4.tgz#b840c2dce46bacf286e237bfb59a29e843399148" - integrity sha512-M4BwiTJjHmLq6kjON7ZoI2JMlBvpY3BYSdiP6s/qCT3jb1s9/DeJF0JELpAxiVSIxXDzfNKe+r7yedMIoLbknQ== + version "8.2.0" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-8.2.0.tgz#3eb56d13a1de1d347ecb1957c6860c911704bc44" + integrity sha512-/Sge3BymXo4lKc31C8OINJgXLaw+7vL1/L1pGiBNpGrBiT8FQiaFpSYV0uhTaG4y78vcMBTMFsWaHDvuD+xGzQ== "@types/node@*", "@types/node@^14.14.13": version "14.14.13" @@ -953,11 +953,6 @@ assign-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= -astral-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" - integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== - astral-regex@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" @@ -2253,10 +2248,10 @@ eslint-config-prettier@7.0.0: resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-7.0.0.tgz#c1ae4106f74e6c0357f44adb076771d032ac0e97" integrity sha512-8Y8lGLVPPZdaNA7JXqnvETVC7IiVRgAP6afQu9gOQRn90YY3otMNh+x7Vr2vMePQntF+5erdSUBqSzCmU/AxaQ== -eslint-plugin-prettier@3.1.4: - version "3.1.4" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.4.tgz#168ab43154e2ea57db992a2cd097c828171f75c2" - integrity sha512-jZDa8z76klRqo+TdGDTFJSavwbnWK2ZpqGKNZ+VvweMW516pDUMmQ2koXvxEE4JhzNvTv+radye/bWGBmA6jmg== +eslint-plugin-prettier@3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.3.0.tgz#61e295349a65688ffac0b7808ef0a8244bdd8d40" + integrity sha512-tMTwO8iUWlSRZIwS9k7/E4vrTsfvsrcM5p1eftyuqWH25nKsz/o6/54I7jwQ/3zobISyC7wMy9ZsFwgTxOcOpQ== dependencies: prettier-linter-helpers "^1.0.0" @@ -2315,50 +2310,7 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== -eslint@7.15.0: - version "7.15.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.15.0.tgz#eb155fb8ed0865fcf5d903f76be2e5b6cd7e0bc7" - integrity sha512-Vr64xFDT8w30wFll643e7cGrIkPEU50yIiI36OdSIDoSGguIeaLzBo0vpGvzo9RECUqq7htURfwEtKqwytkqzA== - dependencies: - "@babel/code-frame" "^7.0.0" - "@eslint/eslintrc" "^0.2.2" - ajv "^6.10.0" - chalk "^4.0.0" - cross-spawn "^7.0.2" - debug "^4.0.1" - doctrine "^3.0.0" - enquirer "^2.3.5" - eslint-scope "^5.1.1" - eslint-utils "^2.1.0" - eslint-visitor-keys "^2.0.0" - espree "^7.3.1" - esquery "^1.2.0" - esutils "^2.0.2" - file-entry-cache "^6.0.0" - functional-red-black-tree "^1.0.1" - glob-parent "^5.0.0" - globals "^12.1.0" - ignore "^4.0.6" - import-fresh "^3.0.0" - imurmurhash "^0.1.4" - is-glob "^4.0.0" - js-yaml "^3.13.1" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.4.1" - lodash "^4.17.19" - minimatch "^3.0.4" - natural-compare "^1.4.0" - optionator "^0.9.1" - progress "^2.0.0" - regexpp "^3.1.0" - semver "^7.2.1" - strip-ansi "^6.0.0" - strip-json-comments "^3.1.0" - table "^5.2.3" - text-table "^0.2.0" - v8-compile-cache "^2.0.3" - -eslint@^7.9.0: +eslint@7.16.0, eslint@^7.9.0: version "7.16.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.16.0.tgz#a761605bf9a7b32d24bb7cde59aeb0fd76f06092" integrity sha512-iVWPS785RuDA4dWuhhgXTNrGxHHK3a8HLSMBgbbU59ruJDubUraXN8N5rn7kb8tG6sjg74eE0RA3YWT51eusEw== @@ -3884,12 +3836,7 @@ lodash.once@^4.0.0: resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" integrity sha1-DdOXEhPHxW34gJd9UEyI+0cal6w= -lodash@^4.16.3, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.2.1: - version "4.17.19" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" - integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ== - -lodash@^4.17.20: +lodash@^4.16.3, lodash@^4.17.11, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.2.1: version "4.17.20" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== @@ -4964,10 +4911,10 @@ raw-body@2.4.0: iconv-lite "0.4.24" unpipe "1.0.0" -react-dom@16.13.1: - version "16.13.1" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.13.1.tgz#c1bd37331a0486c078ee54c4740720993b2e0e7f" - integrity sha512-81PIMmVLnCNLO/fFOQxdQkvEq/+Hfpv24XNJfpyZhTRfO0QcmQIF/PgCa1zCOj2w1hrn12MFLyaJ/G0+Mxtfag== +react-dom@16.14.0: + version "16.14.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.14.0.tgz#7ad838ec29a777fb3c75c3a190f661cf92ab8b89" + integrity sha512-1gCeQXDLoIqMgqD3IO2Ah9bnf0w9kzhwN5q4FGnHZ67hBm9yePzB5JJAIQCc8x3pFnNlwFq4RidZggNAAkzWWw== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" @@ -5508,15 +5455,6 @@ sinon@^9.0.3: nise "^4.0.4" supports-color "^7.1.0" -slice-ansi@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" - integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== - dependencies: - ansi-styles "^3.2.0" - astral-regex "^1.0.0" - is-fullwidth-code-point "^2.0.0" - slice-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" @@ -5912,16 +5850,6 @@ table-layout@^1.0.1: typical "^5.2.0" wordwrapjs "^4.0.0" -table@^5.2.3: - version "5.4.6" - resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" - integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== - dependencies: - ajv "^6.10.2" - lodash "^4.17.14" - slice-ansi "^2.1.0" - string-width "^3.0.0" - table@^6.0.4: version "6.0.4" resolved "https://registry.yarnpkg.com/table/-/table-6.0.4.tgz#c523dd182177e926c723eb20e1b341238188aa0d" |