-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (76 loc) · 2.45 KB
/
mrubyedge.yml
File metadata and controls
79 lines (76 loc) · 2.45 KB
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
name: mruby/edge CI
on:
push:
branches:
- master
paths:
- 'mrubyedge/**'
- 'mrubyedge-cli/**'
pull_request:
branches:
- master
paths:
- 'mrubyedge/**'
- 'mrubyedge-cli/**'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
BUILD_TARGET: [release] # refers to a cargo profile
ENABLE_FNV_HASH: ["", ",mruby-hash-fnv"]
steps:
- uses: actions/checkout@v5
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install C compiler
run: sudo apt-get update && sudo apt-get install -y build-essential
- name: Run formatter
run: |
set -e
cargo fmt -p mrubyedge --check
cargo fmt -p mrubyedge-cli --check
- name: Run tests for "${{ matrix.BUILD_TARGET }}${{ matrix.ENABLE_FNV_HASH }}" profile
run: |
set +e
cargo test -p mrubyedge \
--features "mrubyedge-debug,mruby-random,mruby-regexp${{ matrix.ENABLE_FNV_HASH }}" \
--profile ${{ matrix.BUILD_TARGET }}
TEST_RESULT=$?
if [ $TEST_RESULT != 0 ]; then
echo "Some tests failed. Debug:"
git diff
exit $TEST_RESULT
fi
- name: Run extra test cases for "${{ matrix.BUILD_TARGET }}" profile
run: |
export MRUBYEDGE_INSN_LIMIT=10000
cargo test --features insn-limit --test insn_limit --profile ${{ matrix.BUILD_TARGET }}
- name: Build binaries for "${{ matrix.BUILD_TARGET }}${{ matrix.ENABLE_FNV_HASH }}" profile
run: |
cargo build -p mrubyedge \
--features "mrubyedge-debug,mruby-random,mruby-regexp${{ matrix.ENABLE_FNV_HASH }}" \
--profile ${{ matrix.BUILD_TARGET }}
cargo build -p mrubyedge-cli
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install C compiler
run: sudo apt-get update && sudo apt-get install -y build-essential
- name: Run linter
run: cargo clippy -p mrubyedge --features "mruby-random,mruby-regexp"