-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from pentamassiv/gh_actions
Added Dependabot and Github Workflows to format, lint, build and test the crate
- Loading branch information
Showing
7 changed files
with
299 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: "Install_deps" | ||
description: "Installs the dependencies and updates the system" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install dependencies | ||
run: | | ||
if [ "$RUNNER_OS" == "Linux" ]; then | ||
sudo apt-get update -q -y && sudo apt-get upgrade -y && sudo apt-get install -y libxdo-dev | ||
echo "$RUNNER_OS" | ||
elif [ "$RUNNER_OS" == "Windows" ]; then | ||
echo "$RUNNER_OS" | ||
elif [ "$RUNNER_OS" == "macOS" ]; then | ||
echo "$RUNNER_OS" | ||
else | ||
echo "$RUNNER_OS not supported" | ||
exit 1 | ||
fi | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: 2 | ||
updates: | ||
|
||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
|
||
# Maintain dependencies for cargo | ||
- package-ecosystem: "cargo" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: build | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
compile: | ||
strategy: | ||
matrix: | ||
rust: | ||
- stable | ||
- nightly | ||
- "1.31.0" | ||
platform: | ||
- ubuntu-latest | ||
- windows-latest | ||
- macos-latest | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/install_deps | ||
- name: Set up Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
- run: cargo check | ||
|
||
compile_all_features: | ||
strategy: | ||
matrix: | ||
rust: | ||
- stable | ||
- nightly | ||
- "1.31.0" | ||
platform: | ||
- ubuntu-latest | ||
- windows-latest | ||
- macos-latest | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/install_deps | ||
- name: Set up Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
- run: cargo check --all-features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: docs | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
compile: | ||
strategy: | ||
matrix: | ||
rust: | ||
- stable | ||
- nightly | ||
- "1.31.0" | ||
platform: | ||
- ubuntu-latest | ||
- windows-latest | ||
- macos-latest | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/install_deps | ||
- name: Set up Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
- run: cargo doc | ||
|
||
doc_all_features: | ||
strategy: | ||
matrix: | ||
rust: | ||
- stable | ||
- nightly | ||
- "1.31.0" | ||
platform: | ||
- ubuntu-latest | ||
- windows-latest | ||
- macos-latest | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/install_deps | ||
- name: Set up Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
- run: cargo doc --all-features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: examples | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
examples: | ||
strategy: | ||
matrix: | ||
rust: | ||
- stable | ||
- nightly | ||
- "1.31.0" | ||
platform: | ||
- ubuntu-latest | ||
- windows-latest | ||
- macos-latest | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/install_deps | ||
- name: Set up Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
- run: cargo check --examples | ||
|
||
examples_all_features: | ||
strategy: | ||
matrix: | ||
rust: | ||
- stable | ||
- nightly | ||
- "1.31.0" | ||
platform: | ||
- ubuntu-latest | ||
- windows-latest | ||
- macos-latest | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/install_deps | ||
- name: Set up Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
- run: cargo check --examples --all-features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: formatting | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
formatting: | ||
strategy: | ||
matrix: | ||
rust: | ||
- stable | ||
- nightly | ||
- "1.31.0" | ||
platform: | ||
- ubuntu-latest | ||
- windows-latest | ||
- macos-latest | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/install_deps | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
components: rustfmt | ||
- run: cargo fmt -- --check | ||
|
||
lint: | ||
strategy: | ||
matrix: | ||
rust: | ||
- stable | ||
- nightly | ||
- "1.31.0" | ||
platform: | ||
- ubuntu-latest | ||
- windows-latest | ||
- macos-latest | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/install_deps | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
components: clippy | ||
- run: cargo clippy --all-targets --all-features -- -D clippy::pedantic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: test | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
rust: | ||
- stable | ||
- nightly | ||
- "1.31.0" | ||
platform: | ||
- ubuntu-latest | ||
- windows-latest | ||
- macos-latest | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/install_deps | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
- name: Test | ||
run: cargo test | ||
|
||
test_all_features: | ||
strategy: | ||
matrix: | ||
rust: | ||
- stable | ||
- nightly | ||
- "1.31.0" | ||
platform: | ||
- ubuntu-latest | ||
- windows-latest | ||
- macos-latest | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/install_deps | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
- name: Test | ||
run: cargo test --all-features |