From ffede0d061dfe1bf26453d4dc1162724bbc5d769 Mon Sep 17 00:00:00 2001 From: Edgard Messias Date: Wed, 12 Feb 2020 08:39:45 -0300 Subject: [PATCH 1/7] chore: Improved github workflow --- .github/workflows/main.yml | 115 +++++++++++++++++++++---------------- 1 file changed, 66 insertions(+), 49 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b26a1d3d..770574f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: build on: push: branches: - - master + - '*' pull_request: branches: - '*' @@ -17,74 +17,31 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-16.04, macOS-latest, windows-2019] - version: ['', 'insiders'] + os: [ubuntu-latest, macOS-latest, windows-latest] + version: ['stable', 'insiders'] steps: - name: Clone repository uses: actions/checkout@v1 - with: - fetch-depth: 1 - name: Setup Node uses: actions/setup-node@v1 with: node-version: '10.x' - - name: Npm cache Posix - if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macOS') - uses: actions/cache@v1 - with: - path: ~/.npm - key: posix-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - posix-node- - - - name: Npm cache Windows - if: startsWith(matrix.os, 'windows') - uses: actions/cache@v1 - with: - path: ~\AppData\Roaming\npm-cache - key: ${{ runner.os }}-node-${{ hashFiles('**\package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - name: Install Dependencies run: 'npm ci || npm ci' shell: bash - - name: Lint check - if: startsWith(matrix.os, 'ubuntu') && matrix.version == '' - run: npm run lint - - - name: Style check - if: startsWith(matrix.os, 'ubuntu') && matrix.version == '' - run: npm run style-check - - name: Compile sources run: npm run build - - name: Start xvfb - if: startsWith(matrix.os, 'ubuntu') - run: /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - - name: Run tests + uses: GabrielBB/xvfb-action@v1.0 + with: + run: npm test env: CODE_VERSION: ${{ matrix.version }} - DISPLAY: ':99.0' - run: npm run test - - - name: Prepare artifact - if: startsWith(matrix.os, 'ubuntu') && matrix.version == '' && github.event_name == 'pull_request' - run: | - node_modules/.bin/vsce package -o svn-scm.vsix - - - name: Upload artifact - if: startsWith(matrix.os, 'ubuntu') && matrix.version == '' && github.event_name == 'pull_request' - uses: actions/upload-artifact@v1 - with: - name: svn-scm.vsix - path: svn-scm.vsix - name: Release if: startsWith(matrix.os, 'ubuntu') && matrix.version == '' && github.ref == 'refs/heads/master' && github.repository == 'JohnstonCode/svn-scm' @@ -97,3 +54,63 @@ jobs: GIT_COMMITTER_EMAIL: ${{ secrets.gitEmail }} GIT_AUTHOR_NAME: ${{ secrets.gitName }} GIT_COMMITTER_NAME: ${{ secrets.gitName }} + + lint: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, 'skip ci')" + + steps: + - name: Clone repository + uses: actions/checkout@v1 + + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: '10.x' + + - name: Install Dependencies + run: 'npm ci || npm ci' + shell: bash + + - name: Lint check + run: npm run lint + + style: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, 'skip ci')" + + steps: + - name: Clone repository + uses: actions/checkout@v1 + + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: '10.x' + + - name: Install Dependencies + run: 'npm ci || npm ci' + shell: bash + + - name: Style check + run: npm run style-check + + artifact: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install Dependencies + run: npm install + + - name: Package extension + uses: lannonbr/vsce-action@master + with: + args: "package -o svn-scm.vsix" + + - name: Upload artifact + uses: actions/upload-artifact@v1 + with: + name: "svn-scm-${{ github.sha }}.vsix" + path: "svn-scm.vsix" From b206da01d65ba9a515360375d1e88e2b7058cbab Mon Sep 17 00:00:00 2001 From: Edgard Messias Date: Wed, 12 Feb 2020 08:53:20 -0300 Subject: [PATCH 2/7] chore: Added reviewdog lint check --- .github/workflows/main.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 770574f1..4d7aea51 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -55,7 +55,7 @@ jobs: GIT_AUTHOR_NAME: ${{ secrets.gitName }} GIT_COMMITTER_NAME: ${{ secrets.gitName }} - lint: + eslint: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, 'skip ci')" @@ -73,7 +73,11 @@ jobs: shell: bash - name: Lint check - run: npm run lint + uses: reviewdog/action-eslint@v1 + with: + github_token: ${{ secrets.github_token }} + reporter: github-check + eslint_flags: "src --ext .ts" style: runs-on: ubuntu-latest @@ -101,8 +105,14 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: '10.x' + - name: Install Dependencies - run: npm install + run: 'npm ci || npm ci' + shell: bash - name: Package extension uses: lannonbr/vsce-action@master From 07763a1352bc1f5ff67c00b0f17c2efe3aab0df3 Mon Sep 17 00:00:00 2001 From: Edgard Messias Date: Wed, 12 Feb 2020 09:33:08 -0300 Subject: [PATCH 3/7] chore: Added cache for vscode binaries --- .github/workflows/main.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4d7aea51..3e2e29e1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,6 +35,16 @@ jobs: - name: Compile sources run: npm run build + + - name: Cache VSCode binary + id: cache-vscode + uses: actions/cache@v1 + with: + path: .vscode-test + key: vscode-${{ runner.os }}-${{ matrix.version }}-${{ github.run_id }} + restore-keys: | + vscode-${{ runner.os }}-${{ matrix.version }}- + vscode-${{ runner.os }}- - name: Run tests uses: GabrielBB/xvfb-action@v1.0 From b388d14921e5ef48392f6aa0247b475a08009209 Mon Sep 17 00:00:00 2001 From: Edgard Messias Date: Wed, 12 Feb 2020 09:48:18 -0300 Subject: [PATCH 4/7] chore: Changed lint report to github-pr-review --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3e2e29e1..9fc48c46 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -86,7 +86,7 @@ jobs: uses: reviewdog/action-eslint@v1 with: github_token: ${{ secrets.github_token }} - reporter: github-check + reporter: github-pr-review eslint_flags: "src --ext .ts" style: From 497d1fe152f6dd739c9e2fe1c5d3452a691f39fe Mon Sep 17 00:00:00 2001 From: Edgard Messias Date: Wed, 12 Feb 2020 09:57:31 -0300 Subject: [PATCH 5/7] chore: Allow failure for insiders build --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9fc48c46..9c6b8876 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -52,9 +52,10 @@ jobs: run: npm test env: CODE_VERSION: ${{ matrix.version }} + continue-on-error: ${{ matrix.version == 'insiders' }} - name: Release - if: startsWith(matrix.os, 'ubuntu') && matrix.version == '' && github.ref == 'refs/heads/master' && github.repository == 'JohnstonCode/svn-scm' + if: startsWith(matrix.os, 'ubuntu') && matrix.version == 'stable' && github.ref == 'refs/heads/master' && github.repository == 'JohnstonCode/svn-scm' run: npm run semantic-release env: VSCE_TOKEN: ${{ secrets.vsceToken }} From 873ca217fceabd663f1717b648fa941ff2c0f7f3 Mon Sep 17 00:00:00 2001 From: Edgard Messias Date: Wed, 12 Feb 2020 10:15:42 -0300 Subject: [PATCH 6/7] chore: Reverted os version --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9c6b8876..1435429f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macOS-latest, windows-latest] + os: [ubuntu-16.04, macOS-latest, windows-2019] version: ['stable', 'insiders'] steps: From dd644305972ab7979f96532879e9822f69fe0fb3 Mon Sep 17 00:00:00 2001 From: Edgard Messias Date: Wed, 12 Feb 2020 10:24:50 -0300 Subject: [PATCH 7/7] chore: Reverted os version --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1435429f..9c6b8876 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-16.04, macOS-latest, windows-2019] + os: [ubuntu-latest, macOS-latest, windows-latest] version: ['stable', 'insiders'] steps: