forked from UziTech/action-setup-atom
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (86 loc) · 2.73 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: "Tests"
on:
pull_request:
push:
branches:
- master
jobs:
Test:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
version: [stable, beta, v1.50.0, v1.50.0-beta0]
source: [action, npm]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Dependencies
run: npm ci
- name: Build Action
if: matrix.source == 'action'
run: npm run build
- name: Install Atom ${{ matrix.version }} with Action
if: matrix.source == 'action'
uses: ./
with:
version: ${{ matrix.version }}
- name: Install Atom ${{ matrix.version }} with NPM
if: matrix.source == 'npm'
run: node ./src/action.js ${{ matrix.version }} ${{ secrets.GITHUB_TOKEN }}
- name: Don't download to repo directory
run: git add . -N && git diff --name-only --exit-code -- . ':!dist'
- name: Run Specs
run: atom --test spec/${{ matrix.version }}
Lint:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Dependencies
run: npm ci
- name: Lint ✨
run: npm run lint
Release:
needs: [Test, Lint]
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- name: Install Dependencies
run: npm ci
- name: Build 🧱
run: |
npm run build
git add dist
if ! git diff --quiet -- dist ; then
git config --global user.email "<>"
git config --global user.name "GitHub Actions"
git commit -m 'chore(build): 🧱 build [skip ci]' --no-verify -- dist
fi
- name: Realease 🎉
uses: cycjimmy/semantic-release-action@v3
id: semantic_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Push to Version Branch
if: steps.semantic_release.outputs.new_release_published == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: v${{ steps.semantic_release.outputs.new_release_major_version }}
Skip:
if: contains(github.event.head_commit.message, '[skip ci]')
runs-on: ubuntu-latest
steps:
- name: Skip CI 🚫
run: echo skip ci