Skip to content

Commit ee63f1e

Browse files
authored
Merge pull request #2 from jhheider/ci
Adds CI workflows and Dependabot configuration
2 parents 917dc1f + b56ffc7 commit ee63f1e

File tree

4 files changed

+153
-0
lines changed

4 files changed

+153
-0
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
- package-ecosystem: cargo
8+
directory: /
9+
schedule:
10+
interval: weekly
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# https://github.com/BamPeers/rust-ci-github-actions-workflow
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
12+
name: Check and Lint
13+
14+
jobs:
15+
check:
16+
name: Check
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: dtolnay/rust-toolchain@stable
21+
- run: cargo check --all-features
22+
env:
23+
RUSTFLAGS: "-D warnings"
24+
25+
fmt:
26+
name: Rustfmt
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: dtolnay/rust-toolchain@stable
31+
- run: rustup component add rustfmt
32+
- run: cargo fmt --all -- --check
33+
34+
clippy:
35+
name: Clippy
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
- uses: dtolnay/rust-toolchain@stable
40+
with:
41+
components: clippy
42+
- run: cargo clippy --all-features
43+
env:
44+
RUSTFLAGS: "-D warnings"
45+
46+
markdownlint:
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v4
50+
- uses: nosborn/github-action-markdown-cli@v3.5.0
51+
with:
52+
files: .
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# https://github.com/BamPeers/rust-ci-github-actions-workflow
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
name: Release Packaging
8+
9+
jobs:
10+
release:
11+
name: Release Packaging
12+
env:
13+
PROJECT_NAME_UNDERSCORE: tea-gpg-wallet
14+
RUSTFLAGS: "-D warnings"
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v5
18+
- uses: dtolnay/rust-toolchain@stable
19+
- name: Release Build
20+
run: cargo build -p tea-gpg-wallet --release
21+
- name: "Upload Artifact"
22+
uses: actions/upload-artifact@v4
23+
with:
24+
name: ${{ env.PROJECT_NAME_UNDERSCORE }}
25+
path: target/release/${{ env.PROJECT_NAME_UNDERSCORE }}
26+
27+
# publish:
28+
# name: Publish to crates.io
29+
# runs-on: ubuntu-latest
30+
# steps:
31+
# - uses: actions/checkout@v5
32+
# - uses: dtolnay/rust-toolchain@stable
33+
# - uses: katyo/publish-crates@v2
34+
# with:
35+
# registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

.github/workflows/test.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# https://github.com/BamPeers/rust-ci-github-actions-workflow
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
name: Test with Code Coverage
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
14+
permissions:
15+
contents: read
16+
checks: write
17+
pull-requests: write
18+
19+
jobs:
20+
test:
21+
strategy:
22+
matrix:
23+
os:
24+
- ubuntu-latest
25+
- macos-latest
26+
- windows-latest
27+
name: Test (${{ matrix.os }})
28+
runs-on: ${{ matrix.os }}
29+
steps:
30+
- uses: actions/checkout@v5
31+
- uses: dtolnay/rust-toolchain@stable
32+
- name: Cache dependencies
33+
uses: actions/cache@v4
34+
env:
35+
cache-name: cache-dependencies
36+
with:
37+
path: |
38+
~/.cargo/
39+
./target
40+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Cargo.lock') }}
41+
- name: Test
42+
run: cargo test --all-features
43+
44+
# TODO: when public
45+
# coverage:
46+
# name: Coverage
47+
# runs-on: ubuntu-latest
48+
# steps:
49+
# - uses: actions/checkout@v5
50+
# - uses: dtolnay/rust-toolchain@stable
51+
# - run: cargo install cargo-tarpaulin
52+
# - name: Generate test result and coverage report
53+
# run: cargo tarpaulin --ignore-tests -o Html -o Lcov --timeout 240 --engine llvm
54+
# - uses: coverallsapp/github-action@v2
55+
# with:
56+
# file: lcov.info

0 commit comments

Comments
 (0)