Skip to content

Commit 4dff9e4

Browse files
committed
shift to github actions
1 parent c8e4f44 commit 4dff9e4

File tree

19 files changed

+165
-82
lines changed

19 files changed

+165
-82
lines changed

.github/workflows/deploy.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Deploy
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
with:
13+
fetch-depth: 0
14+
- name: Install mdbook
15+
run: |
16+
mkdir mdbook
17+
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.14/mdbook-v0.4.14-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
18+
echo `pwd`/mdbook >> $GITHUB_PATH
19+
- name: Deploy GitHub Pages
20+
run: |
21+
# This assumes your book is in the root of your repository.
22+
# Just add a `cd` here if you need to change to another directory.
23+
mdbook build
24+
git worktree add gh-pages
25+
git config user.name "Deploy from CI"
26+
git config user.email ""
27+
cd gh-pages
28+
# Delete the ref to avoid keeping history.
29+
git update-ref -d refs/heads/gh-pages
30+
rm -rf *
31+
mv ../book/* .
32+
git add .
33+
git commit -m "Deploy $GITHUB_SHA to gh-pages"
34+
git push --force --set-upstream origin gh-pages

.github/workflows/main.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
on:
3+
# Only run when merging to master, or open/synchronize/reopen a PR.
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
name: Test
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
build: [stable, beta, nightly, macos, windows, msrv]
16+
include:
17+
- build: stable
18+
os: ubuntu-latest
19+
rust: stable
20+
- build: beta
21+
os: ubuntu-latest
22+
rust: beta
23+
- build: nightly
24+
os: ubuntu-latest
25+
rust: nightly
26+
- build: macos
27+
os: macos-latest
28+
rust: stable
29+
- build: windows
30+
os: windows-latest
31+
rust: stable
32+
- build: msrv
33+
os: ubuntu-latest
34+
# sync MSRV with docs: guide/src/guide/installation.md
35+
rust: 1.56.0
36+
steps:
37+
- uses: actions/checkout@master
38+
- name: Install Rust
39+
run: bash ci/install-rust.sh ${{ matrix.rust }}
40+
- name: Build and run tests
41+
run: cargo test
42+
- name: Test no default
43+
run: cargo test --no-default-features
44+
45+
rustfmt:
46+
name: Rustfmt
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@master
50+
- name: Install Rust
51+
run: rustup update stable && rustup default stable && rustup component add rustfmt
52+
- run: cargo fmt --check

.travis.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ All the questions are in the following format `src/chapterX/questions.md`
1010

1111
All your contributions will be considered under [MIT LICENSE](LICENSE)
1212

13-
Finally execute `mdbook build` after adding questions (provide one solution in [playground](https://play.rust-lang.org/)) and try not
13+
Finally execute `mdbook build` after adding questions (provide one solution
14+
in [playground](https://play.rust-lang.org/)) and try not
1415
include questions that convey the same concept

FAQs.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#### Where can I find solutions to the problems in this book ?
22

3-
I have decided not to provide solutions to any problem in this book, you will have to use the long way(irc channels, stackoverflow, etc).
3+
I have decided not to provide solutions to any problem in this book, you will have to use the long way(irc channels,
4+
stackoverflow, etc).
45

5-
The reason for this is so that you have to study the whole concept rather than a part of it because I feel a lot of new learners simply go and check the solution after being stuck for the first time.
6+
The reason for this is so that you have to study the whole concept rather than a part of it because I feel a lot of new
7+
learners simply go and check the solution after being stuck for the first time.
68

79
Though help will be provided in some questions as a form of `hint`
810

@@ -13,10 +15,12 @@ Each and every question that appears in the book has been solved in at least 2 w
1315
#### Where can I find help ?
1416

1517
Some of the sources that are the most helpful are :
18+
1619
* [Rust IRC Channel for beginners](https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-beginners)
1720
* [Stackoverflow](https://stackoverflow.com/)
1821
* [Reddit community of Rust](https://www.reddit.com/r/rust/)
1922

2023
#### I am unable to solve so-and-so question, why ?
2124

22-
Mostly because you may be new to the language or to programming world itself, try again and keep on learning, you will be able to eventually solve them with ease
25+
Mostly because you may be new to the language or to programming world itself, try again and keep on learning, you will
26+
be able to eventually solve them with ease

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ Read [CONTRIBUTING](CONTRIBUTING.md) for contributing to the book
1212

1313
[![Visit Book](https://img.shields.io/badge/Book-Rendered-brightgreen.svg?style=for-the-badge)](https://sn99.github.io/rust-practise-questions/)
1414

15-
See also the list of [contributors](https://github.com/sn99/rust-practise-questions/graphs/contributors) who participated in this project.
15+
See also the list of [contributors](https://github.com/sn99/rust-practise-questions/graphs/contributors) who
16+
participated in this project.
1617

1718
## License
1819

src/FAQs.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
#### Where can I find solutions to the problems in this book ?
44

5-
I have decided not to provide solutions to any problem in this book, you will have to use the long way(irc channels, stackoverflow, etc).
5+
I have decided not to provide solutions to any problem in this book, you will have to use the long way(irc channels,
6+
stackoverflow, etc).
67

7-
The reason for this is so that you have to study the whole concept rather than a part of it because I feel a lot of new learners simply go and check the solution after being stuck for the first time.
8+
The reason for this is so that you have to study the whole concept rather than a part of it because I feel a lot of new
9+
learners simply go and check the solution after being stuck for the first time.
810

911
Though help will be provided in some questions as a form of `hint`
1012

@@ -15,10 +17,12 @@ Each and every question that appears in the book has been solved in at least in
1517
#### Where can I find help ?
1618

1719
Some of the sources that are the most helpful are :
20+
1821
* [Rust IRC Channel for beginners](https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-beginners)
1922
* [Stackoverflow](https://stackoverflow.com/questions/tagged/rust)
2023
* [Reddit community of Rust](https://www.reddit.com/r/rust/)
2124

2225
#### I am unable to solve so-and-so question, why ?
2326

24-
Mostly because you may be new to the language or to programming world itself, try again and keep on learning, you will be able to eventually solve them with ease
27+
Mostly because you may be new to the language or to programming world itself, try again and keep on learning, you will
28+
be able to eventually solve them with ease

src/RESOURCES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
Some of the sources that might help you in learning [Rust](https://www.rust-lang.org/)
44

5-
* [The rust book (main)](https://doc.rust-lang.org/book/index.html) - It is the main book and should be your companion till the end
5+
* [The rust book (main)](https://doc.rust-lang.org/book/index.html) - It is the main book and should be your companion
6+
till the end
67
* [A gentle introduction to rust](https://stevedonovan.github.io/rust-gentle-intro/readme.html)
78
* [Learning Rust](https://learning-rust.github.io)
89
* [The official site for Documentation](https://www.rust-lang.org/en-US/documentation.html)

src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[About](about.md)
44
[FAQs](FAQs.md)
55
[Learning Resources](RESOURCES.md)
6+
67
- [Chapter 1 - Basics](chapter_1-basics/questions.md)
78
- [Chapter 2 - Expressions](chapter_2-expressions/questions.md)
89
- [Chapter 3 - Structs](chapter_3-structs/questions.md)

src/about.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ The source code of the book is at [link](https://github.com/sn99/rust-practise-q
22

33
# about
44

5-
The book is written so that we newbie [Rustaceans](https://www.rustaceans.org/) can easily dive in the language and get productive as fast as possible
5+
The book is written so that a newbie [Rustaceans](https://www.rustaceans.org/) can easily dive in the language and get
6+
productive as fast as possible
67

78
## What this book is not
89

9-
This book is not an attempt to teach you [Rust](https://www.rust-lang.org/), it simply provides question for practise and **it is not a tutorial**
10+
This book is not an attempt to teach you [Rust](https://www.rust-lang.org/), it simply provides question for practise,
11+
and **it is not a tutorial**

0 commit comments

Comments
 (0)