Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nikoshet committed Oct 18, 2024
0 parents commit 9966b2b
Show file tree
Hide file tree
Showing 35 changed files with 5,113 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI Pipeline

on:
push:
branches:
- main
paths-ignore:
- "README.md"
pull_request:
branches:
- main
paths-ignore:
- "README.md"

concurrency:
group: "${{ github.workflow }} @ ${{ github.head_ref || github.ref }}"
cancel-in-progress: true

env:
RUST_VERSION: 1.81.0
CARGO_TERM_COLOR: always

jobs:
format-and-clippy:
uses: ./.github/workflows/format-workflow.yaml
secrets: inherit
tests:
uses: ./.github/workflows/tests-workflow.yaml
secrets: inherit
build:
runs-on: ubuntu-latest
needs: [format-and-clippy, tests]
strategy:
fail-fast: true
matrix:
include:
- name: "library"
path: "."
- name: "client"
path: "snap-kube-client"
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt, clippy
toolchain: ${{ env.RUST_VERSION }}
- name: Cargo Build ${{ matrix.name }}
run: cargo build --verbose
working-directory: ${{ matrix.path }}
22 changes: 22 additions & 0 deletions .github/workflows/format-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Format & Clippy Pipeline

on:
workflow_call:

env:
RUST_VERSION: 1.81.0

jobs:
format-and-clippy:
name: Cargo format & Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt, clippy
toolchain: ${{ env.RUST_VERSION }}
- name: Rustfmt Check
uses: actions-rust-lang/rustfmt@v1
- name: Lint with Clippy
run: cargo clippy --all
24 changes: 24 additions & 0 deletions .github/workflows/tests-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Tests Pipeline

on:
workflow_call:

env:
RUST_VERSION: 1.81.0

jobs:
tests:
name: Run Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt, clippy
toolchain: ${{ env.RUST_VERSION }}
- name: Install cargo-nextest
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-nextest
- name: Run tests
run: cargo nextest run --all
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# These are backup files generated by rustfmt
**/*.rs.bk

# Added by cargo
/target
.idea/
.DS_Store
.zed/


# Other
script.sh
*.cast
*.gif
data/
*.tgz
Loading

0 comments on commit 9966b2b

Please sign in to comment.