From 8baa6f8d9d6f1387c5bce016daa3441a9d0d20b1 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Fri, 26 Jun 2020 01:14:31 -0500 Subject: [PATCH 1/5] use action-setup-atom --- .github/workflows/ci.yml | 136 ++++++++++----------------------------- 1 file changed, 34 insertions(+), 102 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99ecebd9bf..70e9257aff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,44 +1,38 @@ name: ci on: + pull_request: push: branches: - master - pull_request: - types: - - opened - - reopened - - synchronize jobs: - linux-tests: - name: linux tests - runs-on: ubuntu-18.04 + tests: + name: tests + strategy: + matrix: + # os: [ubuntu-18.04, macos-10.14, windows-2016] + os: [ubuntu-18.04, macos-10.14] + # channel: [stable, beta, nightly] + channel: [nightly] + fail-fast: false + runs-on: ${{ matrix.os }} env: - DISPLAY: ":99" ATOM_GITHUB_BABEL_ENV: coverage MOCHA_TIMEOUT: 60000 UNTIL_TIMEOUT: 30000 steps: - uses: actions/checkout@v1 - name: install Atom - shell: bash + uses: UziTech/action-setup-atom@v1 + with: + channel: ${{ matrix.channel }} + - name: install windows build tools run: | - curl -s -L https://atom.io/download/deb?channel=nightly \ - -H 'Accept: application/octet-stream' \ - -o /tmp/atom-amd64.deb - /sbin/start-stop-daemon --start --quiet \ - --pidfile /tmp/custom_xvfb_99.pid \ - --make-pidfile --background \ - --exec /usr/bin/Xvfb \ - -- :99 -ac -screen 0 1280x1024x16 - sudo apt-get update - sudo apt-get install -yyq libgconf-2-4 build-essential git libsecret-1-dev gvfs-bin - dpkg-deb -x /tmp/atom-amd64.deb /tmp/atom + choco install vcbuildtools + if: contains(matrix.os, 'windows') - name: install dependencies - shell: bash - run: /tmp/atom/usr/share/atom-nightly/resources/app/apm/bin/apm ci + run: apm ci - name: run tests - shell: bash - run: /tmp/atom/usr/bin/atom-nightly --test test/ + run: atom --test test/ - name: report code coverage shell: bash env: @@ -46,107 +40,45 @@ jobs: SYSTEM_PULLREQUEST_PULLREQUESTNUMBER: ${{ github.event.number }} SYSTEM_PULLREQUEST_SOURCEBRANCH: ${{ github.head_ref }} BUILD_SOURCEBRANCH: ${{ github.event.ref }} + OS_NAME: ${{ matrix.os }} run: | npm run report:coverage + COVERAGE_NAME=$([[ "${OS_NAME}" == macos* ]] && echo "macOS" || echo "Linux") bash <(curl -s https://codecov.io/bash) \ - -n "Linux" \ + -n "${COVERAGE_NAME}" \ -P "${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER:-}" \ -B "${SYSTEM_PULLREQUEST_SOURCEBRANCH:-${BUILD_SOURCEBRANCH}}" - if: success() || failure() - - macos-tests: - name: macos tests - runs-on: macos-10.14 - env: - ATOM_GITHUB_BABEL_ENV: coverage - MOCHA_TIMEOUT: 60000 - UNTIL_TIMEOUT: 30000 - steps: - - uses: actions/checkout@v1 - - name: install Atom - shell: bash - run: | - curl -s -L https://atom.io/download/mac?channel=nightly \ - -H 'Accept: application/octet-stream' \ - -o /tmp/atom.zip - sudo unzip -q /tmp/atom.zip -d /tmp/atom - - name: install dependencies - shell: bash - run: | - '/tmp/atom/Atom Nightly.app/Contents/Resources/app/apm/bin/apm' ci - - name: run tests - shell: bash - run: | - '/tmp/atom/Atom Nightly.app/Contents/Resources/app/atom.sh' --test test/ - - name: report code coverage - shell: bash - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - SYSTEM_PULLREQUEST_PULLREQUESTNUMBER: ${{ github.event.number }} - SYSTEM_PULLREQUEST_SOURCEBRANCH: ${{ github.head_ref }} - BUILD_SOURCEBRANCH: ${{ github.event.ref }} - run: | - npm run report:coverage - bash <(curl -s https://codecov.io/bash) \ - -n "macOS" \ - -P "${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER:-}" \ - -B "${SYSTEM_PULLREQUEST_SOURCEBRANCH:-${BUILD_SOURCEBRANCH}}" - if: success() || failure() + if: | + !contains(matrix.os, 'windows') && + (success() || failure()) lint: name: lint runs-on: ubuntu-18.04 - env: - DISPLAY: ":99" steps: - uses: actions/checkout@v1 - name: install Atom - shell: bash - run: | - curl -s -L https://atom.io/download/deb?channel=nightly \ - -H 'Accept: application/octet-stream' \ - -o /tmp/atom-amd64.deb - /sbin/start-stop-daemon --start --quiet \ - --pidfile /tmp/custom_xvfb_99.pid \ - --make-pidfile --background \ - --exec /usr/bin/Xvfb \ - -- :99 -ac -screen 0 1280x1024x16 - sudo apt-get update - sudo apt-get install -yyq libgconf-2-4 build-essential git libsecret-1-dev gvfs-bin - dpkg-deb -x /tmp/atom-amd64.deb /tmp/atom + uses: UziTech/action-setup-atom@v1 + with: + channel: nightly - name: install dependencies - shell: bash - run: /tmp/atom/usr/share/atom-nightly/resources/app/apm/bin/apm ci + run: apm ci - name: lint - shell: bash run: npm run lint snapshot-tests: name: snapshot tests runs-on: ubuntu-18.04 env: - DISPLAY: ":99" ATOM_GITHUB_BABEL_ENV: coverage ATOM_GITHUB_TEST_SUITE: snapshot steps: - uses: actions/checkout@v1 - name: install Atom - shell: bash - run: | - curl -s -L https://atom.io/download/deb?channel=nightly \ - -H 'Accept: application/octet-stream' \ - -o /tmp/atom-amd64.deb - /sbin/start-stop-daemon --start --quiet \ - --pidfile /tmp/custom_xvfb_99.pid \ - --make-pidfile --background \ - --exec /usr/bin/Xvfb \ - -- :99 -ac -screen 0 1280x1024x16 - sudo apt-get update - sudo apt-get install -yyq libgconf-2-4 build-essential git libsecret-1-dev gvfs-bin - dpkg-deb -x /tmp/atom-amd64.deb /tmp/atom + uses: UziTech/action-setup-atom@v1 + with: + channel: nightly - name: install dependencies - shell: bash - run: /tmp/atom/usr/share/atom-nightly/resources/app/apm/bin/apm ci + run: apm ci - name: run snapshot tests - shell: bash - run: /tmp/atom/usr/bin/atom-nightly --test test/ + run: atom --test test/ From ab36e0840362e04055503a9e52314441d9ef3d4c Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 1 Jan 2021 06:28:58 -0600 Subject: [PATCH 2/5] Install visualcpp-build-tools on Windows --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70e9257aff..88e4e78102 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,10 +25,13 @@ jobs: uses: UziTech/action-setup-atom@v1 with: channel: ${{ matrix.channel }} + - name: install windows build tools - run: | - choco install vcbuildtools if: contains(matrix.os, 'windows') + run: | + choco install visualcpp-build-tools --version=14.0.25420.1 --ignore-dependencies -y --params "'/IncludeRequired'" + echo ::set-env name=VCTargetsPath::'C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140' + - name: install dependencies run: apm ci - name: run tests From 7b106ed2b9e21a3fbb5c4340cd1b1ce43a2333a6 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 1 Jan 2021 06:29:52 -0600 Subject: [PATCH 3/5] Run the tests on Windows with continue-on-error --- .github/workflows/ci.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88e4e78102..ab8c3592c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,8 +34,16 @@ jobs: - name: install dependencies run: apm ci - - name: run tests - run: atom --test test/ + + - name: Run the tests + if: ${{ !contains(matrix.os, 'windows') }} + run: atom --test test + + - name: Run the tests on Windows + if: ${{ contains(matrix.os, 'windows') }} + continue-on-error: true # due to https://github.com/atom/github/pull/2459#issuecomment-624725972 + run: atom --test test + - name: report code coverage shell: bash env: From 83317f5cf49cef450739df22744dc61e2db9f759 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 1 Jan 2021 06:30:22 -0600 Subject: [PATCH 4/5] Run CI on Windows --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab8c3592c7..218339957b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,8 +9,7 @@ jobs: name: tests strategy: matrix: - # os: [ubuntu-18.04, macos-10.14, windows-2016] - os: [ubuntu-18.04, macos-10.14] + os: [ubuntu-18.04, macos-10.14, windows-latest] # channel: [stable, beta, nightly] channel: [nightly] fail-fast: false From 8d1a789b927dbd4164353e96b7f3860cfbc0e71a Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 1 Jan 2021 06:35:13 -0600 Subject: [PATCH 5/5] Run CI on beta as well Sometimes Github goes into the beta channel --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 218339957b..33bcdce877 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,8 +10,7 @@ jobs: strategy: matrix: os: [ubuntu-18.04, macos-10.14, windows-latest] - # channel: [stable, beta, nightly] - channel: [nightly] + channel: [beta, nightly] fail-fast: false runs-on: ${{ matrix.os }} env: @@ -24,7 +23,7 @@ jobs: uses: UziTech/action-setup-atom@v1 with: channel: ${{ matrix.channel }} - + - name: install windows build tools if: contains(matrix.os, 'windows') run: |