From a8128deb409ae24cd5ea3e10a03ee12f6e51b10a Mon Sep 17 00:00:00 2001 From: Dominik Jelinek Date: Mon, 23 Jan 2023 17:15:30 +0100 Subject: [PATCH] Provide only one specific CI workflow for main branch (#596) Signed-off-by: Dominik Jelinek --- .github/workflows/linux.yml | 50 ------------------- .github/workflows/mac.yml | 46 ------------------ .github/workflows/main.yml | 90 +++++++++++++++++++++++++++++++++++ .github/workflows/windows.yml | 46 ------------------ README.md | 2 +- 5 files changed, 91 insertions(+), 143 deletions(-) delete mode 100644 .github/workflows/linux.yml delete mode 100644 .github/workflows/mac.yml create mode 100644 .github/workflows/main.yml delete mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml deleted file mode 100644 index 86708b6e2..000000000 --- a/.github/workflows/linux.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Linux CI - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - test: - runs-on: ubuntu-latest - - strategy: - matrix: - node: [ 16 ] - version: [ min, 1.71.2, 1.72.2, 1.73.1, max ] - fail-fast: false - - steps: - - uses: actions/checkout@v3 - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - cache: npm - - name: Setup Dependencies - run: | - rm -f package-lock.json - npm run prepare-deps - npm install - npm run build - npm run prepare-test - - name: Run Tests - env: - CODE_VERSION: ${{ matrix.version }} - run: | - sudo apt-get install xvfb - export DISPLAY=:99.0 - Xvfb -ac :99 -screen 0 1920x1080x16 & - npm run ci-test - - name: Upload screenshots - uses: actions/upload-artifact@v3 - if: failure() - with: - name: screenshots-${{ matrix.version }} - path: ~/test/**/screenshots/*.png diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml deleted file mode 100644 index 42ff8c45c..000000000 --- a/.github/workflows/mac.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: MacOS CI - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - test: - runs-on: macos-latest - - strategy: - matrix: - node: [ 16 ] - version: [ max ] - fail-fast: false - - steps: - - uses: actions/checkout@v3 - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - cache: npm - - name: Setup Dependencies - run: | - rm -f package-lock.json - npm run prepare-deps - npm install - npm run build - npm run prepare-test - - name: Run Tests - env: - CODE_VERSION: ${{ matrix.version }} - run: npm test - - name: Upload screenshots - uses: actions/upload-artifact@v3 - if: failure() - with: - name: screenshots-macos-${{ matrix.version }} - path: test/test-project/test-resources/screenshots/*.png diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..6562fd96e --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,90 @@ +name: Main CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest ] + version: [ min, 1.71.2, 1.72.2, 1.73.1, max ] + include: + - os: macos-latest + version: max + - os: windows-latest + version: max + fail-fast: false + + env: + CODE_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 16 + cache: npm + + - name: Setup Dependencies + run: | + rm package-lock.json + npm run prepare-deps + - name: Install + run: npm install + - name: Build + run: npm run build + - name: Prepare Tests + run: npm run prepare-test + + - name: Run Tests (mac, win) + if: ${{ contains(matrix.os, 'mac') || contains(matrix.os, 'win') }} + run: | + npm run test + + - name: Run Tests (linux) + if: ${{ contains(matrix.os, 'ubuntu') }} + run: | + sudo apt-get install xvfb + export DISPLAY=:99 + Xvfb -ac :99 -screen 0 1920x1080x16 & + npm run ci-test + + - name: Upload Screenshots + uses: actions/upload-artifact@v3 + if: failure() + with: + name: screenshots-${{ matrix.os }}-${{ matrix.version }} + path: test/test-project/**/screenshots/*.png + + check: + if: always() + runs-on: ubuntu-latest + name: Status Check + needs: [ test ] + steps: + - name: Test Matrix Result + run: | + echo result = ${{ needs.test.result }} + - name: Status Check - success + if: ${{ needs.test.result == 'success' }} + run: | + echo "All tests successfully completed!" + exit 0 + - name: Status Check - failure + if: ${{ needs.test.result != 'success' }} + run: | + echo "Status Check failed!" + exit 1 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index da17fe5d5..000000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Windows CI - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - test: - runs-on: windows-latest - - strategy: - matrix: - node: [ 16 ] - version: [ max ] - fail-fast: false - - steps: - - uses: actions/checkout@v3 - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - cache: npm - - name: Setup Dependencies - run: | - rm package-lock.json - npm run prepare-deps - npm install - npm run build - npm run prepare-test - - name: Run Tests - env: - CODE_VERSION: ${{ matrix.version }} - run: npm test - - name: Upload screenshots - uses: actions/upload-artifact@v3 - if: failure() - with: - name: screenshots-${{ matrix.version }} - path: ~/test/**/screenshots/*.png diff --git a/README.md b/README.md index e9a61305c..e8b396af2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ #### Stable VSCode -[![Linux CI](https://github.com/redhat-developer/vscode-extension-tester/actions/workflows/linux.yml/badge.svg)](https://github.com/redhat-developer/vscode-extension-tester/actions/workflows/linux.yml) [![MacOS CI](https://github.com/redhat-developer/vscode-extension-tester/actions/workflows/mac.yml/badge.svg)](https://github.com/redhat-developer/vscode-extension-tester/actions/workflows/mac.yml) [![Windows CI](https://github.com/redhat-developer/vscode-extension-tester/actions/workflows/windows.yml/badge.svg)](https://github.com/redhat-developer/vscode-extension-tester/actions/workflows/windows.yml) +[![Main CI](https://github.com/redhat-developer/vscode-extension-tester/actions/workflows/main.yml/badge.svg)](https://github.com/redhat-developer/vscode-extension-tester/actions/workflows/main.yml) #### Insider VSCode [![Nightly Insiders](https://github.com/redhat-developer/vscode-extension-tester/actions/workflows/insiders.yml/badge.svg)](https://github.com/redhat-developer/vscode-extension-tester/actions/workflows/insiders.yml)