-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (106 loc) · 3.74 KB
/
rust-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
name: Rust CI # https://docs.github.com/en/actions, https://course.rs/test/ci.html
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
#schedule: -cron:'0 0 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
testbench:
#name: Build Rust Project
runs-on: ubuntu-latest # https://github.com/actions/virtual-environments
#strategy:
# matrix:
# toolchain:
# - stable
# - nightly
#
# compiler: [gcc, clang]
# build: [linux, macos, windows]
# include:
# - build: linux
# os: ubuntu-latest
# target: x86_64-unknown-linux-musl
# - build: macos
# os: macos-latest
# target: aarch64-apple-darwin
# - build: windows
# os: windows-latest
# target: x86_64-pc-windows-msvc
# fail-fast: false
steps:
#- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
#- name: Install toolchain
# uses: dtolnay/rust-toolchain@stable
#
# uses: actions-rs/toolchain@v1
# with:
# toolchain: nightly
# #toolchain: ${{ matrix.rust }}
# #target: ${{ matrix.target }}
# #profile: minimal
# #override: true
#- uses: Swatinem/rust-cache@v2
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Checkout repository
uses: actions/checkout@v3
- run: 3rdparty/layout.sh
- name: Run tests
# uses: taiki-e/install-action@nextest
run: cargo t -F "evg,b2d,ftg,ovg,nvg,ugl" -- --nocapture #cargo nextest r
env: # DYLD_FALLBACK_LIBRARY_PATH (macOS), PATH (Windows) # XXX:
LD_LIBRARY_PATH: ${{github.workspace}}/3rdparty/amanithvg/lib/linux/x86_64/sre/standalone
- name: Benchmark
run: cargo bench -F "evg,b2d" #--all-features # evg_fixed,b2d_sfp
# sudo cargo flamegraph --bench engine_2d
#- name: Publish to crates-io
# uses: katyo/publish-crates@v2
# with:
# registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
coverage: # https://github.com/xd009642/tarpaulin
runs-on: ubuntu-latest
#container:
# image: xd009642/tarpaulin:develop-nightly
# options: --security-opt seccomp=unconfined
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-llvm-cov
- run: rustup toolchain install nightly --profile minimal --component llvm-tools
- name: Generate code coverage # https://github.com/actions-rs/tarpaulin
#env:
# CC: clang
# CXX: clang++
run: cargo llvm-cov --lcov --output-path lcov.info #--workspace --all-features
# cargo +nightly llvm-cov --include-ffi --doctests --lcov --output-path lcov.info #--workspace --all-features
# cargo tarpaulin --run-types 'Tests,Doctests' --out Lcov --exclude-files 'inperse/src/*'
# cargo install tarpaulin
#uses: actions-rs/tarpaulin@v0.1 # XXX: no more working
#with:
# #version: '0.20.1'
# #args: '-- --test-threads 1'
# run-types: 'Tests,Doctests'
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
with:
# token: ${{secrets.CODECOV_TOKEN}} # not required for public repos
# fail_ci_if_error: true
files: lcov.info
#- name: Archive code coverage results
# uses: actions/upload-artifact@v3
# with:
# name: code-coverage-report
# path: cobertura.xml