Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
chore!: start porting to rust
Browse files Browse the repository at this point in the history
  • Loading branch information
wizard-28 committed Aug 23, 2022
1 parent be21882 commit 820f53e
Show file tree
Hide file tree
Showing 20 changed files with 312 additions and 1,348 deletions.
2 changes: 2 additions & 0 deletions .codespellignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
crate
mut
13 changes: 3 additions & 10 deletions .github/ISSUE_TEMPLATE/BUG-REPORT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ body:
- type: checkboxes
id: confirmation
attributes:
label: Are you sure this is an issue with LibPacstall and not with the program that uses this library?
label: Are you sure this is an issue with LibPacstall and not with the program that uses this library (or it's bindings)?
options:
- label: Yes, I am sure this is an issue with LibPacstall
required: true
Expand Down Expand Up @@ -50,21 +50,14 @@ body:
attributes:
label: OS version
description: Provide your OS version.
placeholder: Ubuntu 20.04
placeholder: Ubuntu 22.04
validations:
required: true
- type: input
id: libpacstall
attributes:
label: LibPacstall version
description: |
What LibPacstall version are you using?
You can find the LibPacstall version with:
```bash
python -c "import libpacstall; print(libpacstall.__version__)"
```
description: What LibPacstall version are you using?
validations:
required: true
- type: textarea
Expand Down
18 changes: 9 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: "cargo"
# Look for `Cargo.toml` and `Cargo.lock` in the root directory
directory: "/"
# Check for updates every Monday
schedule:
interval: "daily"
interval: "weekly"
open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
directory: "/"
# Check for updates every Monday
schedule:
interval: "daily"
interval: "weekly"
open-pull-requests-limit: 10
24 changes: 24 additions & 0 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CD # Continuous Deployment

on:
push:
tags:
- '[v]?[0-9]+.[0-9]+.[0-9]+'

jobs:
publish-cargo:
name: Publishing to Cargo
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: publish
args: --token ${{ secrets.CARGO_API_KEY }}
140 changes: 140 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
name: CI # Continuous Integration

on:
workflow_dispatch:
push:
branches: [ master ]
pull_request:

jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --workspace

rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
components: rustfmt
- uses: Swatinem/rust-cache@v1
- name: Check formatting
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: fmt
args: --all -- --check

spellcheck:
name: Spellcheck
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Spellcheck
uses: codespell-project/actions-codespell@master
with:
builtin: clear,rare,informal,code
ignore_words_file: .codespellignore

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: clippy
- uses: Swatinem/rust-cache@v1
- name: Clippy check
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features --workspace -- -D warnings -D clippy::pedantic

docs:
name: Docs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
- name: Check documentation
env:
RUSTDOCFLAGS: -D warnings
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --document-private-items --all-features --workspace --examples

publish-dry-run:
name: Publish dry run
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: publish
args: --dry-run

coverage:
name: Code coverage
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
- name: Run cargo-tarpaulin
uses: actions-rs/[email protected]
with:
args: '--all-features --workspace --ignore-tests'
- name: Upload to CodeCov
uses: codecov/[email protected]
with:
token: ${{secrets.CODECOV_TOKEN}}
28 changes: 28 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Security audit

on:
schedule:
# Runs at 00:00 UTC everyday
- cron: '0 0 * * *'
push:
paths:
- '**/Cargo.toml'
pull_request:

jobs:
audit:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Ensure that the latest version of Cargo is installed
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
70 changes: 0 additions & 70 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/tests.yml

This file was deleted.

Loading

0 comments on commit 820f53e

Please sign in to comment.