|
1 | 1 | name: ci |
2 | 2 | on: |
3 | | - pull_request: |
4 | 3 | push: |
5 | 4 | branches: |
6 | 5 | - master |
| 6 | + pull_request: |
| 7 | + types: |
| 8 | + - opened |
| 9 | + - reopened |
| 10 | + - synchronize |
7 | 11 | jobs: |
8 | | - tests: |
9 | | - name: tests |
10 | | - strategy: |
11 | | - matrix: |
12 | | - os: [ubuntu-18.04, macos-latest, windows-latest] |
13 | | - channel: [beta, nightly] |
14 | | - fail-fast: false |
15 | | - runs-on: ${{ matrix.os }} |
| 12 | + linux-tests: |
| 13 | + name: linux tests |
| 14 | + runs-on: ubuntu-18.04 |
16 | 15 | env: |
| 16 | + DISPLAY: ":99" |
17 | 17 | ATOM_GITHUB_BABEL_ENV: coverage |
| 18 | + ATOM_CHANNEL: nightly |
| 19 | + ATOM: /tmp/atom/usr/bin/atom-nightly |
| 20 | + APM: /tmp/atom/usr/share/atom-nightly/resources/app/apm/bin/apm |
18 | 21 | MOCHA_TIMEOUT: 60000 |
19 | 22 | UNTIL_TIMEOUT: 30000 |
20 | 23 | steps: |
21 | 24 | - uses: actions/checkout@v1 |
22 | 25 | - name: install Atom |
23 | | - uses: UziTech/action-setup-atom@v1 |
24 | | - with: |
25 | | - channel: ${{ matrix.channel }} |
26 | | - |
27 | | - - name: install windows build tools |
28 | | - if: contains(matrix.os, 'windows') |
| 26 | + shell: bash |
29 | 27 | run: | |
30 | | - choco install visualcpp-build-tools --version=14.0.25420.1 --ignore-dependencies -y --params "'/IncludeRequired'" |
31 | | - echo "VCTargetsPath='C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140'" >> $GITHUB_ENV |
| 28 | + curl -s -L https://atom.io/download/deb?channel=${ATOM_CHANNEL} \ |
| 29 | + -H 'Accept: application/octet-stream' \ |
| 30 | + -o /tmp/atom-amd64.deb |
| 31 | + /sbin/start-stop-daemon --start --quiet \ |
| 32 | + --pidfile /tmp/custom_xvfb_99.pid \ |
| 33 | + --make-pidfile --background \ |
| 34 | + --exec /usr/bin/Xvfb \ |
| 35 | + -- :99 -ac -screen 0 1280x1024x16 |
| 36 | + sudo apt-get update |
| 37 | + sudo apt-get install -yyq libgconf-2-4 build-essential git libsecret-1-dev gvfs-bin |
| 38 | + dpkg-deb -x /tmp/atom-amd64.deb /tmp/atom |
32 | 39 | - name: install dependencies |
33 | | - run: apm ci |
34 | | - |
| 40 | + shell: bash |
| 41 | + run: ${APM} ci |
35 | 42 | - name: configure git |
36 | 43 | shell: bash |
37 | 44 | run: | |
38 | 45 | git config --global user.name Hubot |
39 | 46 | git config --global user.email [email protected] |
| 47 | + - name: run tests |
| 48 | + shell: bash |
| 49 | + run: ${ATOM} --test test/ |
| 50 | + - name: report code coverage |
| 51 | + shell: bash |
| 52 | + env: |
| 53 | + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
| 54 | + SYSTEM_PULLREQUEST_PULLREQUESTNUMBER: ${{ github.event.number }} |
| 55 | + SYSTEM_PULLREQUEST_SOURCEBRANCH: ${{ github.head_ref }} |
| 56 | + BUILD_SOURCEBRANCH: ${{ github.event.ref }} |
| 57 | + run: | |
| 58 | + npm run report:coverage |
| 59 | + bash <(curl -s https://codecov.io/bash) \ |
| 60 | + -n "Linux" \ |
| 61 | + -P "${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER:-}" \ |
| 62 | + -B "${SYSTEM_PULLREQUEST_SOURCEBRANCH:-${BUILD_SOURCEBRANCH}}" |
| 63 | + if: success() || failure() |
40 | 64 |
|
41 | | - - name: Run the tests |
42 | | - if: ${{ !contains(matrix.os, 'windows') }} |
43 | | - run: atom --test test |
44 | | - |
45 | | - - name: Run the tests on Windows |
46 | | - if: ${{ contains(matrix.os, 'windows') }} |
47 | | - continue-on-error: true # due to https://github.com/atom/github/pull/2459#issuecomment-624725972 |
48 | | - run: atom --test test |
49 | | - |
| 65 | + macos-tests: |
| 66 | + name: macos tests |
| 67 | + runs-on: macos-10.14 |
| 68 | + env: |
| 69 | + ATOM_GITHUB_BABEL_ENV: coverage |
| 70 | + ATOM_CHANNEL: nightly |
| 71 | + ATOM: /tmp/atom/Atom\ Nightly.app/Contents/Resources/app/atom.sh |
| 72 | + APM: /tmp/atom/Atom\ Nightly.app/Contents/Resources/app/apm/bin/apm |
| 73 | + MOCHA_TIMEOUT: 60000 |
| 74 | + UNTIL_TIMEOUT: 30000 |
| 75 | + steps: |
| 76 | + - uses: actions/checkout@v1 |
| 77 | + - name: install Atom |
| 78 | + shell: bash |
| 79 | + run: | |
| 80 | + curl -s -L https://atom.io/download/mac?channel=${ATOM_CHANNEL} \ |
| 81 | + -H 'Accept: application/octet-stream' \ |
| 82 | + -o /tmp/atom.zip |
| 83 | + sudo unzip -q /tmp/atom.zip -d /tmp/atom |
| 84 | + - name: install dependencies |
| 85 | + shell: bash |
| 86 | + run: sh -c "${APM} ci" |
| 87 | + - name: configure git |
| 88 | + shell: bash |
| 89 | + run: | |
| 90 | + git config --global user.name Hubot |
| 91 | + git config --global user.email [email protected] |
| 92 | + - name: run tests |
| 93 | + shell: bash |
| 94 | + run: sh -c "${ATOM} --test test/" |
50 | 95 | - name: report code coverage |
51 | 96 | shell: bash |
52 | 97 | env: |
53 | 98 | CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
54 | 99 | SYSTEM_PULLREQUEST_PULLREQUESTNUMBER: ${{ github.event.number }} |
55 | 100 | SYSTEM_PULLREQUEST_SOURCEBRANCH: ${{ github.head_ref }} |
56 | 101 | BUILD_SOURCEBRANCH: ${{ github.event.ref }} |
57 | | - OS_NAME: ${{ matrix.os }} |
58 | 102 | run: | |
59 | 103 | npm run report:coverage |
60 | | - COVERAGE_NAME=$([[ "${OS_NAME}" == macos* ]] && echo "macOS" || echo "Linux") |
61 | 104 | bash <(curl -s https://codecov.io/bash) \ |
62 | | - -n "${COVERAGE_NAME}" \ |
| 105 | + -n "macOS" \ |
63 | 106 | -P "${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER:-}" \ |
64 | 107 | -B "${SYSTEM_PULLREQUEST_SOURCEBRANCH:-${BUILD_SOURCEBRANCH}}" |
65 | | - if: | |
66 | | - !contains(matrix.os, 'windows') && |
67 | | - (success() || failure()) |
| 108 | + if: success() || failure() |
| 109 | + |
68 | 110 | lint: |
69 | 111 | name: lint |
70 | 112 | runs-on: ubuntu-18.04 |
| 113 | + env: |
| 114 | + DISPLAY: ":99" |
| 115 | + ATOM_CHANNEL: nightly |
| 116 | + ATOM: /tmp/atom/usr/bin/atom-nightly |
| 117 | + APM: /tmp/atom/usr/share/atom-nightly/resources/app/apm/bin/apm |
71 | 118 | steps: |
72 | 119 | - uses: actions/checkout@v1 |
73 | 120 | - name: install Atom |
74 | | - uses: UziTech/action-setup-atom@v1 |
75 | | - with: |
76 | | - channel: nightly |
| 121 | + shell: bash |
| 122 | + run: | |
| 123 | + curl -s -L https://atom.io/download/deb?channel=${ATOM_CHANNEL} \ |
| 124 | + -H 'Accept: application/octet-stream' \ |
| 125 | + -o /tmp/atom-amd64.deb |
| 126 | + /sbin/start-stop-daemon --start --quiet \ |
| 127 | + --pidfile /tmp/custom_xvfb_99.pid \ |
| 128 | + --make-pidfile --background \ |
| 129 | + --exec /usr/bin/Xvfb \ |
| 130 | + -- :99 -ac -screen 0 1280x1024x16 |
| 131 | + sudo apt-get update |
| 132 | + sudo apt-get install -yyq libgconf-2-4 build-essential git libsecret-1-dev gvfs-bin |
| 133 | + dpkg-deb -x /tmp/atom-amd64.deb /tmp/atom |
77 | 134 | - name: install dependencies |
78 | | - run: apm ci |
| 135 | + shell: bash |
| 136 | + run: ${APM} ci |
79 | 137 | - name: lint |
| 138 | + shell: bash |
80 | 139 | run: npm run lint |
81 | 140 |
|
82 | 141 | snapshot-tests: |
83 | 142 | name: snapshot tests |
84 | 143 | runs-on: ubuntu-18.04 |
85 | 144 | env: |
| 145 | + DISPLAY: ":99" |
| 146 | + ATOM_CHANNEL: nightly |
| 147 | + ATOM: /tmp/atom/usr/bin/atom-nightly |
| 148 | + APM: /tmp/atom/usr/share/atom-nightly/resources/app/apm/bin/apm |
86 | 149 | ATOM_GITHUB_BABEL_ENV: coverage |
87 | 150 | ATOM_GITHUB_TEST_SUITE: snapshot |
88 | 151 | steps: |
89 | 152 | - uses: actions/checkout@v1 |
90 | 153 | - name: install Atom |
91 | | - uses: UziTech/action-setup-atom@v1 |
92 | | - with: |
93 | | - channel: nightly |
| 154 | + shell: bash |
| 155 | + run: | |
| 156 | + curl -s -L https://atom.io/download/deb?channel=${ATOM_CHANNEL} \ |
| 157 | + -H 'Accept: application/octet-stream' \ |
| 158 | + -o /tmp/atom-amd64.deb |
| 159 | + /sbin/start-stop-daemon --start --quiet \ |
| 160 | + --pidfile /tmp/custom_xvfb_99.pid \ |
| 161 | + --make-pidfile --background \ |
| 162 | + --exec /usr/bin/Xvfb \ |
| 163 | + -- :99 -ac -screen 0 1280x1024x16 |
| 164 | + sudo apt-get update |
| 165 | + sudo apt-get install -yyq libgconf-2-4 build-essential git libsecret-1-dev gvfs-bin |
| 166 | + dpkg-deb -x /tmp/atom-amd64.deb /tmp/atom |
94 | 167 | - name: install dependencies |
95 | | - run: apm ci |
| 168 | + shell: bash |
| 169 | + run: ${APM} ci |
96 | 170 | - name: run snapshot tests |
97 | | - run: atom --test test/ |
| 171 | + shell: bash |
| 172 | + run: ${ATOM} --test test/ |
0 commit comments