-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (113 loc) · 3.98 KB
/
push-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
name: push ci
on:
push:
branches:
- "**"
workflow_dispatch:
env:
RUSTFLAGS: "-Cinstrument-coverage -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code"
jobs:
test:
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on:
- ubuntu-22.04
- ubuntu-24.04
- macos-14
steps:
- name: checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: setup rust
run: rustc --version
- name: build
run: cargo build --verbose --features all-unstable,all-addons
- name: test
run: cargo test --verbose --features all-unstable,all-addons
env:
CARGO_INCREMENTAL: "0"
LLVM_PROFILE_FILE: "target/coverage/test-%m-%p.profraw"
- name: fetch/run grcov
run: |
platform=$(uname)
case $platform in
Darwin)
# macos-14 runners run on apple silicon, so aarch64
curl -Lo grcov.bz2 https://github.com/mozilla/grcov/releases/download/v0.8.19/grcov-aarch64-apple-darwin.tar.bz2
;;
Linux)
curl -Lo grcov.bz2 https://github.com/mozilla/grcov/releases/download/v0.8.19/grcov-x86_64-unknown-linux-musl.tar.bz2
;;
*)
echo weird
exit 1
;;
esac
tar xvf grcov.bz2
rm grcov.bz2
./grcov . -s . -t lcov --binary-path ./target/debug/ --branch --ignore-not-existing -o ./target/coverage/tests.lcov
- name: upload to codecov
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
files: target/coverage/*.lcov
token: ${{ secrets.CODECOV_TOKEN }}
clippy:
uses: ./.github/workflows/clippy.yml
feature-check:
uses: ./.github/workflows/feature-check.yml
verify-gen-features:
uses: ./.github/workflows/verify-gen-features.yml
docs:
needs:
- test
- feature-check
- verify-gen-features
# TODO enable when existing warnings have been cleared
# - clippy
runs-on: ubuntu-24.04
steps:
- name: checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: setup rust
run: rustc --version
- name: install fish shell
run: |
sudo add-apt-repository -yn ppa:fish-shell/release-3
sudo apt-get update
sudo apt-get install fish
- name: generate docs
shell: fish {0}
run: |
set -gx RUSTDOCFLAGS "--cfg docsrs --cfg kiwingay -Z unstable-options --enable-index-page --theme "(pwd)"/.cargo/rustdoc-custom-theme/meadow.css"
set -gx KIWINGAY_DEPLOY_COMMIT_SHORT (string sub --length 8 $KIWINGAY_DEPLOY_COMMIT)
cargo doc --verbose --no-deps --features all-unstable,all-addons --lib -p wiwi -p wiwiwiwiwi
env:
KIWINGAY_DEPLOY_COMMIT: ${{ github.sha }}
- name: checkout gh-pages branch
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
path: gh-pages
ref: gh-pages
- name: deploy docs
shell: fish {0}
run: |
rm -rf gh-pages/*
mv gh-pages/.git gh-pages/git
rm -rf gh-pages/.*
mv gh-pages/git gh-pages/.git
cp -R target/doc/* gh-pages
cp -R target/doc/.* gh-pages
cp .gitignore gh-pages/.gitignore
touch gh-pages/.nojekyll
echo wiwi.kiwin.gay > gh-pages/CNAME
set COMMIT_MESSAGE "(automated) deploy from commit "(git rev-parse HEAD)
cd gh-pages
git config --global user.name "smol"
git config --global user.email "107521333+a-tiny-kirin@users.noreply.github.com"
echo https://meadowsys:${{ secrets.GHPAT }}@github.com > .git/credentials
git config --global credential.helper "store --file=.git/credentials"
git config --unset-all http.https://github.com/.extraheader # https://stackoverflow.com/a/69979203
git add -A
git commit -m "$COMMIT_MESSAGE" --allow-empty
git push