Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 6ab7dd6

Browse files
authored
Merge pull request #2459 from UziTech/setup-atom
use action-setup-atom
2 parents 6951c7b + b7eb37e commit 6ab7dd6

File tree

1 file changed

+43
-118
lines changed

1 file changed

+43
-118
lines changed

.github/workflows/ci.yml

Lines changed: 43 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,172 +1,97 @@
11
name: ci
22
on:
3+
pull_request:
34
push:
45
branches:
56
- master
6-
pull_request:
7-
types:
8-
- opened
9-
- reopened
10-
- synchronize
117
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 }}
1516
env:
16-
DISPLAY: ":99"
1717
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
2118
MOCHA_TIMEOUT: 60000
2219
UNTIL_TIMEOUT: 30000
2320
steps:
2421
- uses: actions/checkout@v1
2522
- 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 }}
6426

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')
7929
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 "VCTargetsPath='C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140'" >> $GITHUB_ENV
8432
- name: install dependencies
85-
shell: bash
86-
run: sh -c "${APM} ci"
33+
run: apm ci
34+
8735
- name: configure git
8836
shell: bash
8937
run: |
9038
git config --global user.name Hubot
9139
git config --global user.email [email protected]
92-
- name: run tests
93-
shell: bash
94-
run: sh -c "${ATOM} --test test/"
40+
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+
9550
- name: report code coverage
9651
shell: bash
9752
env:
9853
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
9954
SYSTEM_PULLREQUEST_PULLREQUESTNUMBER: ${{ github.event.number }}
10055
SYSTEM_PULLREQUEST_SOURCEBRANCH: ${{ github.head_ref }}
10156
BUILD_SOURCEBRANCH: ${{ github.event.ref }}
57+
OS_NAME: ${{ matrix.os }}
10258
run: |
10359
npm run report:coverage
60+
COVERAGE_NAME=$([[ "${OS_NAME}" == macos* ]] && echo "macOS" || echo "Linux")
10461
bash <(curl -s https://codecov.io/bash) \
105-
-n "macOS" \
62+
-n "${COVERAGE_NAME}" \
10663
-P "${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER:-}" \
10764
-B "${SYSTEM_PULLREQUEST_SOURCEBRANCH:-${BUILD_SOURCEBRANCH}}"
108-
if: success() || failure()
109-
65+
if: |
66+
!contains(matrix.os, 'windows') &&
67+
(success() || failure())
11068
lint:
11169
name: lint
11270
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
11871
steps:
11972
- uses: actions/checkout@v1
12073
- 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
74+
uses: UziTech/action-setup-atom@v1
75+
with:
76+
channel: nightly
13477
- name: install dependencies
135-
shell: bash
136-
run: ${APM} ci
78+
run: apm ci
13779
- name: lint
138-
shell: bash
13980
run: npm run lint
14081

14182
snapshot-tests:
14283
name: snapshot tests
14384
runs-on: ubuntu-18.04
14485
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
14986
ATOM_GITHUB_BABEL_ENV: coverage
15087
ATOM_GITHUB_TEST_SUITE: snapshot
15188
steps:
15289
- uses: actions/checkout@v1
15390
- 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
91+
uses: UziTech/action-setup-atom@v1
92+
with:
93+
channel: nightly
16794
- name: install dependencies
168-
shell: bash
169-
run: ${APM} ci
95+
run: apm ci
17096
- name: run snapshot tests
171-
shell: bash
172-
run: ${ATOM} --test test/
97+
run: atom --test test/

0 commit comments

Comments
 (0)