forked from micromatch/micromatch
-
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (71 loc) · 2.13 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
##
# GitHub CI workflow.
#
# GitHub is aware of this config file's location.
#
# @note CUSTOM EDITS ONLY PLEASE!
# @note In the future this file will be updated automatically.
# @note Only `<custom:start.../custom:end>` will be preserved below.
##
name: 'CI' # <https://o5p.me/QsaIUU>
run-name: 'CI by @${{github.actor}}'
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
workflow_dispatch:
concurrency:
cancel-in-progress: true
group: ${{github.workflow}}-${{github.ref}}
jobs:
deployment:
strategy:
matrix:
os: [ubuntu-latest]
node-version: [20.5.1]
runs-on: ${{matrix.os}}
environment: ci # CI environment.
permissions: # GitHub token permissions.
contents: read # Mininum requirements.
env: # Supplied by permissions above.
USER_GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
# Supplied by org-wide action secrets.
USER_NPM_TOKEN: ${{secrets.USER_NPM_TOKEN}}
# Supplied by repo environment secrets.
# Only available for repos using a Dotenv Vault.
USER_DOTENV_KEY_MAIN: ${{secrets.USER_DOTENV_KEY_MAIN || ''}}
USER_DOTENV_KEY_CI: ${{secrets.USER_DOTENV_KEY_CI || ''}}
steps:
- name: Checkout Project Repo
uses: actions/checkout@v3
- name: Setup Node v${{matrix.node-version}}
uses: actions/setup-node@v3
with:
node-version: ${{matrix.node-version}}
cache: npm # Caches NPM dependencies.
- name: Parse Project Package JSON
shell: bash
run: |
echo 'PKG_JSON='"$(jq -c . ./package.json)" >> $GITHUB_ENV;
echo 'PKG_JSON_C10N='"$(jq -c '.config | .c10n | .["&"]' ./package.json)" >> $GITHUB_ENV;
- name: Install Madrun Dependency
shell: bash
run: |
npm install -g @clevercanyon/madrun;
- name: Install Project
shell: bash
run: |
madrun install project --mode=ci;
- name: Run Project Tests
if: fromJson(env.PKG_JSON_C10N).build.appType
shell: bash
run: |
madrun tests --mode=ci;
#
##
# Customizations
# <custom:start>
# </custom:end>