-
Notifications
You must be signed in to change notification settings - Fork 19
83 lines (80 loc) · 2.32 KB
/
nodejs.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
name: Node CI
on:
pull_request: ~
push:
branches:
# These are the branches that we want CI to run on direct pushes.
# All other changes should go through PRs.
- master
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v1
# # Move this action to just before the failing step to debug it.
# - name: Setup tmate session for remote debugging
# uses: mxschmitt/action-tmate@v3
- name: Cache node_modules
uses: actions/cache@v1
with:
path: node_modules
key: node_modules-${{ hashFiles('yarn.lock') }}
restore-keys: |
node_modules-
- name: Cache maven
uses: actions/cache@v1
with:
path: ~/.m2
key: m2-${{ hashFiles('shadow-cljs.edn') }}
restore-keys: |
m2-
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install
run: yarn
- name: Lint
run: yarn lint
- name: Start background server
run: yarn sc start
- name: Build
run: yarn build
- name: Test
run: yarn test:once
- name: E2E
run: yarn e2e
- name: Archive Production Artifact
# Only upload the Linux build.
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v2
with:
name: dist
path: dist
release:
if: github.ref == 'refs/heads/master' && github.repository == 'filipesilva/create-cljs-app'
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Download Artifact
uses: actions/download-artifact@v2
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# Test the release if one was made.
# Would be nice to group these steps on the `if` conditional, but no way to do it yet.
- name: Use Node.js 12.x
if: steps.semantic.outputs.new_release_published == 'true'
uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Try to use release
if: steps.semantic.outputs.new_release_published == 'true'
run: yarn create cljs-app my-cljs-app