From 26f1e4854d76eb60a6cbfbf981991ed232c573c3 Mon Sep 17 00:00:00 2001 From: Shin'ya UEOKA Date: Fri, 1 Jan 2021 00:48:39 +0000 Subject: Hello, GitHub Actioons --- .github/workflows/build.yaml | 66 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/build.yaml (limited to '.github/workflows') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..0b4d2ad --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,66 @@ +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: + firefox-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: + firefox-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 build + - run: yarn test:e2e -- cgit v1.2.3 From 66eaab218cb19107e34c80cc8f755234f4c62d84 Mon Sep 17 00:00:00 2001 From: Shin'ya UEOKA Date: Fri, 1 Jan 2021 01:21:18 +0000 Subject: Start geckodriver --- .github/workflows/build.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0b4d2ad..feed80e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -63,4 +63,6 @@ jobs: - run: yarn install - run: yarn build - - run: yarn test:e2e + - run: | + geckodriver & + yarn test:e2e -- cgit v1.2.3 From de70645737e595f9c8db22b7e5150916ce733fd2 Mon Sep 17 00:00:00 2001 From: Shin'ya UEOKA Date: Fri, 1 Jan 2021 01:52:57 +0000 Subject: Run Xvfb --- .github/workflows/build.yaml | 4 ++++ 1 file changed, 4 insertions(+) (limited to '.github/workflows') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index feed80e..095fd74 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -64,5 +64,9 @@ jobs: - run: yarn install - run: yarn build - run: | + export DISPLAY=:99 + geckodriver & + sudo Xvfb -ac :99 -screen 0 1280x1024x24 >/dev/null 2>&1 & + yarn test:e2e -- cgit v1.2.3 From 39bee8e26485db1763102c57b0980944b2d56266 Mon Sep 17 00:00:00 2001 From: Shin'ya UEOKA Date: Fri, 1 Jan 2021 02:13:57 +0000 Subject: Install xsel on GitHub Actions --- .github/workflows/build.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 095fd74..c356735 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -50,6 +50,8 @@ jobs: - uses: ueokande/setup-geckodriver@latest with: firefox-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 @@ -63,7 +65,8 @@ jobs: - run: yarn install - run: yarn build - - run: | + - name: Run test + run: | export DISPLAY=:99 geckodriver & -- cgit v1.2.3 From 641493a99bf2647b7a0c1b4e7f627cefcc63e12e Mon Sep 17 00:00:00 2001 From: Shin'ya UEOKA Date: Fri, 1 Jan 2021 03:03:27 +0000 Subject: Add deploy step --- .github/workflows/build.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to '.github/workflows') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c356735..776a498 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -73,3 +73,31 @@ jobs: 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 + run: | + version=$(jq -r '.version' manifest.json) + ./script/deploy vim-vixen@i-beam.org "$version" "vim-vixen-${version}.zip" -- cgit v1.2.3 From e936c5ee2e95c0f4e43a1a6872b1011e9c5e7ec0 Mon Sep 17 00:00:00 2001 From: Shin'ya UEOKA Date: Fri, 1 Jan 2021 09:57:29 +0000 Subject: Set AMO secrets --- .github/workflows/build.yaml | 3 +++ 1 file changed, 3 insertions(+) (limited to '.github/workflows') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 776a498..9c89c50 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -98,6 +98,9 @@ jobs: - 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" -- cgit v1.2.3 From 7cedc3dd891c2c57291564ced8fb6606b44e2b5e Mon Sep 17 00:00:00 2001 From: Shin'ya UEOKA Date: Fri, 1 Jan 2021 10:23:33 +0000 Subject: Fix setup-geckodriver parameter --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9c89c50..1c2fc62 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -19,7 +19,7 @@ jobs: firefox-version: 78.3.0esr - uses: ueokande/setup-geckodriver@latest with: - firefox-version: 0.28.0 + geckodriver-version: 0.28.0 - name: Get yarn cache directory path id: yarn-cache-dir-path @@ -49,7 +49,7 @@ jobs: firefox-version: 78.3.0esr - uses: ueokande/setup-geckodriver@latest with: - firefox-version: 0.28.0 + geckodriver-version: 0.28.0 - name: Install xsel run: sudo apt-get install -y --no-install-recommends xsel -- cgit v1.2.3