-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (93 loc) · 2.77 KB
/
ci.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: 'CI Pipeline'
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
jobs:
ci:
name: 'Build / Test / Report'
runs-on: 'ubuntu-latest'
outputs:
has_versioning: ${{ steps.check_versioning.outputs.files_exists }}
steps:
- name: Checkout Repo
uses: 'actions/checkout@v3'
with:
fetch-depth: 0
- name: "Check if versioning is requested"
uses: andstor/file-existence-action@v2
id: check_versioning
with:
files: ".yarn/versions/*"
- name: Setup Environment
uses: 'actions/setup-node@v3'
with:
cache: 'yarn'
- name: Install Dependencies
run: 'yarn install --immutable'
- name: Run CI Tasks
run: 'yarn moon ci'
env:
MOONBASE_SECRET_KEY: ${{ secrets.MOONBASE_SECRET_KEY }}
MOONBASE_ACCESS_KEY: ${{ secrets.MOONBASE_ACCESS_KEY }}
- name: Report Moon CI Status
uses: 'moonrepo/run-report-action@v1'
if: success() || failure()
with:
access-token: ${{ secrets.GITHUB_TOKEN }}
versioning:
name: "Versioning"
runs-on: 'ubuntu-latest'
needs: ci
if: needs.ci.outputs.has_versioning == 'true' && github.ref == 'refs/heads/master'
steps:
- name: Checkout Repo
uses: 'actions/checkout@v3'
with:
fetch-depth: 0
- name: Setup Environment
uses: 'actions/setup-node@v3'
with:
cache: 'yarn'
- name: Install Dependencies
run: 'yarn install --immutable'
- name: Run versioning
run: 'yarn version apply --all'
- name: Publish packages
run: 'yarn moon run :publish'
env:
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Save Versioning
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "chore(ci): Automatic Versioning"
commit_options: '--no-verify --signoff'
commit_user_name: CI Bot
commit_user_email: [email protected]
coverage:
name: 'Coverage'
runs-on: 'ubuntu-latest'
needs: ci
steps:
- name: Checkout Repo
uses: 'actions/checkout@v3'
with:
fetch-depth: 0
- name: Setup Environment
uses: 'actions/setup-node@v3'
with:
cache: 'yarn'
- name: Install Dependencies
run: 'yarn install --immutable'
- name: Run setup
run: 'yarn moon run :build'
- name: Run Coverage
run: 'yarn coverage'
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
with:
directory: coverage
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true