-
Notifications
You must be signed in to change notification settings - Fork 12
150 lines (145 loc) · 5.03 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
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
142
143
144
145
146
147
148
149
150
name: Run test and verifier
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
strategy:
matrix:
version:
- '1.9.1'
runs-on: ubuntu-latest
container:
image: crystallang/crystal:${{ matrix.version }}
# https://github.com/SimonKagstrom/kcov/issues/151#issuecomment-249284631
options: --security-opt seccomp=unconfined
steps:
- name: Install latest git
run: |
apt-get update
apt-get install software-properties-common -y
apt-add-repository ppa:git-core/ppa -y
apt-get install git -y
- uses: actions/checkout@v3
- name: Install dependencies
run: |
apt-get install python3 libpython3.8 python3-dev python3-pip bash libxml2-dev libxslt-dev build-essential binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev cmake curl wget -y
- name: Install kcov
run: |
cd /tmp
git clone --depth 1 -b v38 https://github.com/SimonKagstrom/kcov.git
mkdir -p kcov/build
cd kcov/build
cmake ..
make -j8
make install
- name: Run tests
run: crystal spec --verbose
- name: Run Benchmarks
run: crystal run --release benchmarks/*
- name: Run coverage
if: ${{ matrix.version == '1.9.1' }}
run: |
shards build test --ignore-crystal-version
kcov --clean --include-path=src coverage ./bin/test
bash <(curl -s https://codecov.io/bash) -s coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
shell: bash
lint:
runs-on: ubuntu-latest
container:
image: crystallang/crystal:1.9.1
steps:
- uses: actions/checkout@v3
- name: Install Crystal dependencies
run: |
shards install
# We only need bin directory. lib contains recursive symlink and troublesome.
rm -rf lib
- name: Run linter
run: bin/ameba
verify:
strategy:
matrix:
version:
- '1.9.1'
runs-on: ubuntu-latest
container:
image: crystallang/crystal:${{ matrix.version }}
steps:
- name: Install latest git
run: |
apt-get update
apt-get install software-properties-common -y
apt-add-repository ppa:git-core/ppa -y
apt-get install git -y
git config --global --add safe.directory /__w/ac-library.cr/ac-library.cr
- uses: actions/checkout@v3
- name: Cache .verify-helper
uses: actions/cache@v2
with:
path: |
.verify-helper/cache
.verify-helper/timestamps.local.json
key: ${{ runner.os }}-crystal-${{ matrix.version }}-verify-helper
- name: Install dependencies
run: |
apt-get install python3 libpython3.8 python3-dev python3-pip bash libxml2-dev libxslt-dev build-essential binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev libyaml-dev libgdbm-dev libreadline-dev libncurses5-dev cmake curl wget time -y
- name: Install Crystal dependencies
run: |
shards install
# We only need bin directory. lib contains recursive symlink and troublesome.
rm -rf lib
- name: Install pip dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
- name: Run verifier
run: oj-verify run --jobs 4
deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
container:
image: crystallang/crystal:1.9.1
needs:
- test
- lint
- verify
steps:
- uses: actions/checkout@v3
- name: Configure git
run: |
git config --global --add safe.directory /__w/ac-library.cr/ac-library.cr
- name: Install Crystal dependencies
run: |
shards install
# We only need bin directory. lib contains recursive symlink and troublesome.
rm -rf lib
- name: Install dependencies
run: |
apt-get update
apt-get install python3 libpython3.8 python3-dev python3-pip bash libxml2-dev libxslt-dev build-essential binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev libyaml-dev libgdbm-dev libreadline-dev libncurses5-dev cmake curl wget time -y
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
- name: Install pip dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
- name: Generate bundled docs
run: oj-verify docs --jobs 4
- name: Generate API docs
run: crystal docs --progress --stats --time -o dist/api
- name: Build bundled docs
run: |
gem install bundler
bundle install --gemfile=.verify-helper/markdown/Gemfile --path .vendor/bundle
bundle exec --gemfile=.verify-helper/markdown/Gemfile jekyll build --source .verify-helper/markdown --destination dist/docs --baseurl ac-library.cr/docs
- name: Deploy docs to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist