-
Notifications
You must be signed in to change notification settings - Fork 234
133 lines (130 loc) · 3.99 KB
/
main.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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [x86_64, i686, x86_64-musl, mingw, system-curl, openssl-110, x86_64-beta, x86_64-nightly, macos, win64, win32]
include:
- build: x86_64
os: ubuntu-latest
rust: stable
docker: linux64
target: x86_64-unknown-linux-gnu
- build: x86_64-beta
os: ubuntu-latest
rust: beta
docker: linux64
target: x86_64-unknown-linux-gnu
- build: x86_64-nightly
os: ubuntu-latest
rust: nightly
docker: linux64
target: x86_64-unknown-linux-gnu
- build: i686
os: ubuntu-latest
rust: stable
docker: linux32
target: i686-unknown-linux-gnu
- build: x86_64-musl
os: ubuntu-latest
rust: stable
docker: musl
target: x86_64-unknown-linux-musl
- build: mingw
os: ubuntu-latest
rust: stable
docker: mingw
target: x86_64-pc-windows-gnu
no_run: true
- build: system-curl
os: ubuntu-latest
rust: stable
docker: linux64-curl
target: x86_64-unknown-linux-gnu
- build: openssl-110
os: ubuntu-latest
rust: stable
docker: centos7
target: x86_64-unknown-linux-gnu
- build: macos
os: macos-latest
rust: stable
target: x86_64-apple-darwin
- build: win32
os: windows-latest
rust: stable
target: i686-pc-windows-msvc
- build: win64
os: windows-latest
rust: stable
target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Install Rust (rustup)
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
shell: bash
- run: rustup target add ${{ matrix.target }}
- run: TARGET=${{ matrix.target }} ./ci/run.sh
if: matrix.os != 'ubuntu-latest'
name: Run non-docker tests
shell: bash
- run: |
set -e
cargo generate-lockfile
mkdir .cargo target
docker build -t rust -f ci/Dockerfile-${{ matrix.docker }} ci
docker run \
-w /src \
-v `pwd`:/src:ro \
-v `pwd`/target:/src/target \
-v `pwd`/ci/.cargo:/src/.cargo:ro \
-v `rustc --print sysroot`:/usr/local:ro \
-e TARGET=${{ matrix.target }} \
-e NO_RUN=${{ matrix.no_run }} \
-e CARGO_TARGET_DIR=/src/target \
rust \
sh ci/run.sh
if: matrix.os == 'ubuntu-latest'
name: Run docker tests
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Install Rust
run: rustup update stable && rustup default stable && rustup component add rustfmt
- run: cargo fmt -- --check
publish_docs:
name: Publish Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Install Rust
run: rustup update stable && rustup default stable
- name: Install dependencies
run: |
sudo apt update
sudo apt install libkrb5-dev
- name: Build documentation
run: cargo doc --no-deps --all-features
- name: Publish documentation
run: |
cd target/doc
git init
git add .
git -c user.name='ci' -c user.email='ci' commit -m init
git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages
if: github.event_name == 'push' && github.event.ref == 'refs/heads/main'