Skip to content

Commit 03746c9

Browse files
Merge #97
97: scrape examples r=Emilgardis a=Emilgardis - simplify and improve doc generation with xtask - don't use surf in examples - simplify examples a bit - don't request scopes for app access token - remove not needed env Co-authored-by: Emil Gardström <emil.gardstrom@gmail.com>
2 parents a6b9974 + f1b1f55 commit 03746c9

File tree

11 files changed

+221
-249
lines changed

11 files changed

+221
-249
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,7 @@ jobs:
4646
with:
4747
toolchain: ${{ matrix.rust }}
4848
override: true
49-
- name: Ready cache
50-
if: matrix.os == 'ubuntu-latest'
51-
run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
52-
- name: Cache cargo
53-
uses: actions/cache@v1
54-
id: cache
55-
with:
56-
path: |
57-
~/.cargo/registry/index
58-
~/.cargo/registry/cache
59-
~/.cargo/git
60-
target
61-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
49+
- uses: Swatinem/rust-cache@v2
6250
- name: Test twitch_oauth2
6351
uses: actions-rs/cargo@v1
6452
with:
@@ -91,16 +79,7 @@ jobs:
9179
toolchain: nightly
9280
override: true
9381
components: clippy
94-
- name: Cache cargo
95-
uses: actions/cache@v1
96-
id: cache
97-
with:
98-
path: |
99-
~/.cargo/registry/index
100-
~/.cargo/registry/cache
101-
~/.cargo/git
102-
target
103-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
82+
- uses: Swatinem/rust-cache@v2
10483
- name: Run clippy
10584
uses: actions-rs/cargo@v1
10685
with:
@@ -121,27 +100,12 @@ jobs:
121100
profile: minimal
122101
toolchain: nightly
123102
override: true
124-
- name: Cache cargo
125-
uses: actions/cache@v1
126-
id: cache
127-
with:
128-
path: |
129-
~/.cargo/registry/index
130-
~/.cargo/registry/cache
131-
~/.cargo/git
132-
target
133-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
103+
- uses: Swatinem/rust-cache@v2
134104
# We do the following to make sure docs.rs can document properly without anything broken, and that docs are working.
135105
- name: Run doc tests
136106
uses: actions-rs/cargo@v1
137107
with:
138108
command: test
139109
args: --doc --all-features
140110
- name: Check twitch_oauth2 docs
141-
uses: actions-rs/cargo@v1
142-
env:
143-
RUSTDOCFLAGS: "--cfg nightly"
144-
RUSTFLAGS: "--cfg nightly"
145-
with:
146-
command: doc
147-
args: --locked --no-deps --features "${{ env.CI_TWITCH_OAUTH2_FEATURES }}"
111+
run: cargo xtask doc

.github/workflows/gh-pages.yml

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
name: github pages
2-
env:
3-
CI_TWITCH_OAUTH2_FEATURES: "all mock_api"
4-
RUSTDOCFLAGS: "-Z unstable-options --html-in-header=docs/pre-content.html --cfg nightly"
5-
RUSTFLAGS: "--cfg nightly"
62
on:
73
push:
84
branches:
@@ -17,29 +13,13 @@ jobs:
1713
profile: minimal
1814
toolchain: nightly
1915
override: true
20-
- name: Cache cargo
21-
uses: actions/cache@v1
22-
id: cache
23-
with:
24-
path:
25-
~/.cargo/registry/index
26-
~/.cargo/registry/cache
27-
~/.cargo/git
28-
target
29-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
30-
- name: mention 40 character commit rev in doc
31-
run: sed -i "s/{{commit}}/$(git rev-parse HEAD)/g" docs/pre-content.html
32-
- name: mention short commit rev in doc
33-
run: sed -i "s/{{commit_short}}/$(git rev-parse --short HEAD)/g" docs/pre-content.html
16+
- uses: Swatinem/rust-cache@v2
3417
- name: build twitch_oauth2 docs
35-
uses: actions-rs/cargo@v1
36-
with:
37-
command: doc
38-
args: --no-deps --features "${{ env.CI_TWITCH_OAUTH2_FEATURES }}"
18+
run: cargo xtask doc
3919
- name: move index.html
40-
run: cp ./docs/index.html ./target/doc/index.html
20+
run: cp ./docs/index.html ./target/extra/doc/index.html
4121
- name: Deploy
4222
uses: peaceiris/actions-gh-pages@v3
4323
with:
4424
github_token: ${{ secrets.GITHUB_TOKEN }}
45-
publish_dir: ./target/doc
25+
publish_dir: ./target/extra/doc

0 commit comments

Comments
 (0)