Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 96e6e4a

Browse files
committed
use action-setup-atom
1 parent 8e10ef6 commit 96e6e4a

File tree

1 file changed

+42
-123
lines changed

1 file changed

+42
-123
lines changed

.github/workflows/ci.yml

Lines changed: 42 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -1,172 +1,91 @@
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 ::set-env name=VCTargetsPath::'C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140'
8432
- 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+
9544
- name: report code coverage
9645
shell: bash
9746
env:
9847
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
9948
SYSTEM_PULLREQUEST_PULLREQUESTNUMBER: ${{ github.event.number }}
10049
SYSTEM_PULLREQUEST_SOURCEBRANCH: ${{ github.head_ref }}
10150
BUILD_SOURCEBRANCH: ${{ github.event.ref }}
51+
OS_NAME: ${{ matrix.os }}
10252
run: |
10353
npm run report:coverage
54+
COVERAGE_NAME=$([[ "${OS_NAME}" == macos* ]] && echo "macOS" || echo "Linux")
10455
bash <(curl -s https://codecov.io/bash) \
105-
-n "macOS" \
56+
-n "${COVERAGE_NAME}" \
10657
-P "${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER:-}" \
10758
-B "${SYSTEM_PULLREQUEST_SOURCEBRANCH:-${BUILD_SOURCEBRANCH}}"
108-
if: success() || failure()
109-
59+
if: |
60+
!contains(matrix.os, 'windows') &&
61+
(success() || failure())
11062
lint:
11163
name: lint
11264
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
11865
steps:
11966
- uses: actions/checkout@v1
12067
- 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
13471
- name: install dependencies
135-
shell: bash
136-
run: ${APM} ci
72+
run: apm ci
13773
- name: lint
138-
shell: bash
13974
run: npm run lint
14075

14176
snapshot-tests:
14277
name: snapshot tests
14378
runs-on: ubuntu-18.04
14479
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
14980
ATOM_GITHUB_BABEL_ENV: coverage
15081
ATOM_GITHUB_TEST_SUITE: snapshot
15182
steps:
15283
- uses: actions/checkout@v1
15384
- 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
16788
- name: install dependencies
168-
shell: bash
169-
run: ${APM} ci
89+
run: apm ci
17090
- name: run snapshot tests
171-
shell: bash
172-
run: ${ATOM} --test test/
91+
run: atom --test test/

0 commit comments

Comments
 (0)