Skip to content

Commit

Permalink
Merge pull request #128 from pentamassiv/gh_actions
Browse files Browse the repository at this point in the history
Added Dependabot and Github Workflows to format, lint, build and test the crate
  • Loading branch information
pentamassiv authored Jan 23, 2023
2 parents 5bb84e9 + bcd2d99 commit 432af1d
Show file tree
Hide file tree
Showing 7 changed files with 299 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/actions/install_deps/action.yaml
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
14 changes: 14 additions & 0 deletions .github/dependabot.yml
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"
53 changes: 53 additions & 0 deletions .github/workflows/build.yml
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
53 changes: 53 additions & 0 deletions .github/workflows/docs.yml
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
53 changes: 53 additions & 0 deletions .github/workflows/examples.yml
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
53 changes: 53 additions & 0 deletions .github/workflows/format.yml
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
53 changes: 53 additions & 0 deletions .github/workflows/test.yml
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

0 comments on commit 432af1d

Please sign in to comment.