teloxide/.github/workflows/ci.yml

99 lines
2.4 KiB
YAML
Raw Normal View History

2020-07-04 20:34:07 +06:00
on:
push:
branches: [ master ]
pull_request:
2020-08-17 18:30:19 +03:00
branches: [ master, dev ]
2019-11-27 17:30:33 +03:00
name: Continuous integration
jobs:
2020-07-02 15:48:37 +03:00
code-checks:
2019-11-27 17:30:33 +03:00
runs-on: ubuntu-latest
steps:
2020-07-03 15:52:16 +03:00
- uses: actions/checkout@v2
2019-11-27 17:30:33 +03:00
- uses: actions-rs/toolchain@v1
with:
profile: minimal
2020-07-02 15:57:06 +03:00
toolchain: nightly
2019-11-27 17:30:33 +03:00
override: true
2020-07-02 15:57:06 +03:00
components: rustfmt, clippy
2020-07-02 15:48:37 +03:00
- name: Cargo fmt
2020-07-02 15:54:24 +03:00
run: cargo +nightly fmt --all -- --check
2020-07-03 15:50:28 +03:00
- uses: actions-rs/toolchain@v1
2019-11-27 17:30:33 +03:00
with:
2020-07-03 15:50:28 +03:00
profile: minimal
toolchain: stable
override: true
2020-07-02 15:48:37 +03:00
- name: Cargo clippy
2020-07-25 01:48:17 +06:00
run: cargo clippy --all --all-targets --all-features -- -D warnings
test:
2020-07-02 15:48:37 +03:00
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
include:
- rust: stable
features: "--features \"redis-storage cbor-serializer bincode-serializer frunk-\""
- rust: beta
features: "--features \"redis-storage cbor-serializer bincode-serializer frunk-\""
- rust: nightly
features: "--all-features"
2020-07-02 15:52:42 +03:00
steps:
2020-07-03 15:52:16 +03:00
- uses: actions/checkout@v2
2020-07-03 15:50:28 +03:00
- uses: actions-rs/toolchain@v1
2019-11-27 17:30:33 +03:00
with:
2020-07-03 15:50:28 +03:00
profile: minimal
toolchain: ${{ matrix.rust }}
2020-07-03 15:50:28 +03:00
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose ${{ matrix.features }}
- name: Setup redis
run: |
sudo apt install redis-server
redis-server --port 7777 > /dev/null &
redis-server --port 7778 > /dev/null &
redis-server --port 7779 > /dev/null &
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose ${{ matrix.features }}
build-example:
2020-07-02 15:48:37 +03:00
runs-on: ubuntu-latest
2020-07-03 19:09:53 +03:00
strategy:
matrix:
example: [
admin_bot,
dialogue_bot,
heroku_ping_pong_bot,
ngrok_ping_pong_bot,
dices_bot,
2020-07-03 19:09:53 +03:00
shared_state_bot,
simple_commands_bot,
redis_remember_bot,
2020-07-03 19:09:53 +03:00
]
2020-07-02 15:52:42 +03:00
steps:
2020-07-03 15:52:16 +03:00
- uses: actions/checkout@v2
2020-07-03 15:50:28 +03:00
- uses: actions-rs/toolchain@v1
2020-03-27 18:54:06 +06:00
with:
2020-07-03 15:50:28 +03:00
profile: minimal
toolchain: stable
override: true
- name: Check the example
run: cd examples && cd ${{ matrix.example }} && cargo check