This repository has been archived by the owner on Mar 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
141 lines (118 loc) · 3.98 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
on:
push:
branches-ignore:
- 'staging.tmp'
- 'trying.tmp'
name: CI
jobs:
static_analysis:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v1
- name: Extract toolchain version from rust-toolchain
run: echo "::set-env name=RUST_TOOLCHAIN::$(cat rust-toolchain)"
- name: Install ${{ env.RUST_TOOLCHAIN }} toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
- name: Cache ~/.cargo/bin directory
uses: actions/cache@v1
with:
path: ~/.cargo/bin
key: ubuntu-rust-${{ env.RUST_TOOLCHAIN }}-cargo-bin-directory
- name: Check formatting
run: make check_format
- name: Run linter
run: make clippy
build:
strategy:
matrix:
os: [macos, ubuntu, windows]
include:
- os: windows
binary-suffix: .exe
- os: ubuntu
binary-suffix: ""
- os: macos
binary-suffix: ""
runs-on: ${{ matrix.os }}-latest
steps:
- name: Checkout sources
uses: actions/checkout@v1
- name: Extract toolchain version from rust-toolchain
run: echo "::set-env name=RUST_TOOLCHAIN::$(cat rust-toolchain)"
- name: Install ${{ env.RUST_TOOLCHAIN }} toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
- name: Add strawperryperl to the PATH to override the existing Perl installation so we can compile OpenSSL locally
if: matrix.os == 'windows'
run: cp C:/strawberry/perl/bin/perl.exe C:/Users/runneradmin/.cargo/bin
- name: Cache target directory
if: matrix.os == 'ubuntu'
uses: actions/cache@v1
with:
path: target
key: ${{ matrix.os }}-rust-${{ env.RUST_TOOLCHAIN }}-target-directory-${{ hashFiles('Cargo.lock') }}
- name: Cache ~/.cargo/registry directory
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ matrix.os }}-rust-${{ env.RUST_TOOLCHAIN }}-cargo-registry-directory-${{ hashFiles('Cargo.lock') }}
- name: Build ${{ matrix.os }} binary
run: make build
- name: Run unit tests
run: make test
- name: Upload create-comit-app ${{ matrix.os }} binary
uses: actions/upload-artifact@v1
with:
name: create-comit-app-${{ matrix.os }}-debug
path: target/debug/create-comit-app${{ matrix.binary-suffix }}
- name: Upload comit-scripts ${{ matrix.os }} binary
uses: actions/upload-artifact@v1
with:
name: comit-scripts-${{ matrix.os }}-debug
path: target/debug/comit-scripts${{ matrix.binary-suffix }}
e2e_test:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout sources
uses: actions/checkout@v1
- name: Download create-comit-app binary
uses: actions/download-artifact@v1
with:
name: create-comit-app-ubuntu-debug
path: target/debug
- name: Download comit-scripts binary
uses: actions/download-artifact@v1
with:
name: comit-scripts-ubuntu-debug
path: target/debug
- name: Fix missing executable permission
run: |
chmod +x target/debug/create-comit-app
chmod +x target/debug/comit-scripts
- name: Install NodeJS 10.x
uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Run e2e tests
run: make e2e_scenarios
npm_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js 10.x
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: "Yarn install all"
run: make yarn_install_all
- name: "Yarn check all"
run: make yarn_check_all