|
1 | 1 | name: ci
|
2 | 2 | on:
|
| 3 | + pull_request: |
3 | 4 | push:
|
4 | 5 | branches:
|
5 | 6 | - master
|
6 |
| - pull_request: |
7 |
| - types: |
8 |
| - - opened |
9 |
| - - reopened |
10 |
| - - synchronize |
11 | 7 | jobs:
|
12 |
| - linux-tests: |
13 |
| - name: linux tests |
14 |
| - runs-on: ubuntu-18.04 |
| 8 | + tests: |
| 9 | + name: tests |
| 10 | + strategy: |
| 11 | + matrix: |
| 12 | + os: [ubuntu-18.04, macos-10.14, windows-latest] |
| 13 | + channel: [beta, nightly] |
| 14 | + fail-fast: false |
| 15 | + runs-on: ${{ matrix.os }} |
15 | 16 | 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 |
21 | 18 | MOCHA_TIMEOUT: 60000
|
22 | 19 | UNTIL_TIMEOUT: 30000
|
23 | 20 | steps:
|
24 | 21 | - uses: actions/checkout@v1
|
25 | 22 | - name: install Atom
|
26 |
| - shell: bash |
27 |
| - run: | |
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 |
39 |
| - - name: install dependencies |
40 |
| - shell: bash |
41 |
| - run: ${APM} ci |
42 |
| - - name: configure git |
43 |
| - shell: bash |
44 |
| - run: | |
45 |
| - git config --global user.name Hubot |
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() |
| 23 | + uses: UziTech/action-setup-atom@v1 |
| 24 | + with: |
| 25 | + channel: ${{ matrix.channel }} |
64 | 26 |
|
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 |
| 27 | + - name: install windows build tools |
| 28 | + if: contains(matrix.os, 'windows') |
79 | 29 | 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 |
| 30 | + choco install visualcpp-build-tools --version=14.0.25420.1 --ignore-dependencies -y --params "'/IncludeRequired'" |
| 31 | + echo ::set-env name=VCTargetsPath::'C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140' |
84 | 32 | - 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/" |
| 33 | + run: apm ci |
| 34 | + |
| 35 | + - name: Run the tests |
| 36 | + if: ${{ !contains(matrix.os, 'windows') }} |
| 37 | + run: atom --test test |
| 38 | + |
| 39 | + - name: Run the tests on Windows |
| 40 | + if: ${{ contains(matrix.os, 'windows') }} |
| 41 | + continue-on-error: true # due to https://github.com/atom/github/pull/2459#issuecomment-624725972 |
| 42 | + run: atom --test test |
| 43 | + |
95 | 44 | - name: report code coverage
|
96 | 45 | shell: bash
|
97 | 46 | env:
|
98 | 47 | CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
99 | 48 | SYSTEM_PULLREQUEST_PULLREQUESTNUMBER: ${{ github.event.number }}
|
100 | 49 | SYSTEM_PULLREQUEST_SOURCEBRANCH: ${{ github.head_ref }}
|
101 | 50 | BUILD_SOURCEBRANCH: ${{ github.event.ref }}
|
| 51 | + OS_NAME: ${{ matrix.os }} |
102 | 52 | run: |
|
103 | 53 | npm run report:coverage
|
| 54 | + COVERAGE_NAME=$([[ "${OS_NAME}" == macos* ]] && echo "macOS" || echo "Linux") |
104 | 55 | bash <(curl -s https://codecov.io/bash) \
|
105 |
| - -n "macOS" \ |
| 56 | + -n "${COVERAGE_NAME}" \ |
106 | 57 | -P "${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER:-}" \
|
107 | 58 | -B "${SYSTEM_PULLREQUEST_SOURCEBRANCH:-${BUILD_SOURCEBRANCH}}"
|
108 |
| - if: success() || failure() |
109 |
| - |
| 59 | + if: | |
| 60 | + !contains(matrix.os, 'windows') && |
| 61 | + (success() || failure()) |
110 | 62 | lint:
|
111 | 63 | name: lint
|
112 | 64 | 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 |
118 | 65 | steps:
|
119 | 66 | - uses: actions/checkout@v1
|
120 | 67 | - name: install Atom
|
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 |
| 68 | + uses: UziTech/action-setup-atom@v1 |
| 69 | + with: |
| 70 | + channel: nightly |
134 | 71 | - name: install dependencies
|
135 |
| - shell: bash |
136 |
| - run: ${APM} ci |
| 72 | + run: apm ci |
137 | 73 | - name: lint
|
138 |
| - shell: bash |
139 | 74 | run: npm run lint
|
140 | 75 |
|
141 | 76 | snapshot-tests:
|
142 | 77 | name: snapshot tests
|
143 | 78 | runs-on: ubuntu-18.04
|
144 | 79 | 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 |
149 | 80 | ATOM_GITHUB_BABEL_ENV: coverage
|
150 | 81 | ATOM_GITHUB_TEST_SUITE: snapshot
|
151 | 82 | steps:
|
152 | 83 | - uses: actions/checkout@v1
|
153 | 84 | - name: install Atom
|
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 |
| 85 | + uses: UziTech/action-setup-atom@v1 |
| 86 | + with: |
| 87 | + channel: nightly |
167 | 88 | - name: install dependencies
|
168 |
| - shell: bash |
169 |
| - run: ${APM} ci |
| 89 | + run: apm ci |
170 | 90 | - name: run snapshot tests
|
171 |
| - shell: bash |
172 |
| - run: ${ATOM} --test test/ |
| 91 | + run: atom --test test/ |
0 commit comments