Compare commits
26 Commits
Author | SHA1 | Date | |
---|---|---|---|
8ebe2d8aff | |||
a67e1439eb | |||
db1a21f5b3 | |||
475ac447d6 | |||
b645c1cdaa | |||
3c6be42b9e | |||
f5997f3ab2 | |||
8b02f33718 | |||
cd95c46131 | |||
89b62242bf | |||
ae6539e456 | |||
c751a3240e | |||
2cca88d709 | |||
9b57da84c3 | |||
82575d8d6a | |||
c39a6ec626 | |||
a239e5d867 | |||
68ff9732ae | |||
a85f43ea4f | |||
c8725cf861 | |||
94f274d4d4 | |||
91b1aeb1be | |||
89ea97dd6a | |||
bd4e7eadcb | |||
02d175676a | |||
202f146467 |
224
.drone.yml
224
.drone.yml
@ -1,28 +1,196 @@
|
||||
kind: pipeline
|
||||
name: test-on-amd64
|
||||
|
||||
platform:
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: test
|
||||
image: rust:alpine
|
||||
commands:
|
||||
- rustc --version
|
||||
- cargo --version
|
||||
- cargo test --verbose --all
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: test-on-arm64
|
||||
|
||||
platform:
|
||||
arch: arm64
|
||||
|
||||
steps:
|
||||
- name: test
|
||||
image: rust:alpine
|
||||
commands:
|
||||
- rustc --version
|
||||
- cargo --version
|
||||
- cargo test --verbose --all
|
||||
kind: pipeline
|
||||
name: amd64 [debug]
|
||||
|
||||
platform:
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: build [debug]
|
||||
image: rust:1.71.1-slim-bookworm
|
||||
commands:
|
||||
- rustc --version
|
||||
- cargo --version
|
||||
# Stupid workarounds, for stupid problems
|
||||
- echo "nameserver 1.1.1.1" >> /etc/resolv.conf
|
||||
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf
|
||||
- cargo build --all
|
||||
|
||||
- name: test [debug]
|
||||
image: rust:1.71.1-slim-bookworm
|
||||
commands:
|
||||
- rustc --version
|
||||
- cargo --version
|
||||
# Stupid workarounds, for stupid problems
|
||||
- echo "nameserver 1.1.1.1" >> /etc/resolv.conf
|
||||
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf
|
||||
- cargo test --all
|
||||
|
||||
- name: lint-clippy [debug]
|
||||
image: rust:1.71.1-slim-bookworm
|
||||
commands:
|
||||
- rustc --version
|
||||
- cargo --version
|
||||
# Stupid workarounds, for stupid problems
|
||||
- echo "nameserver 1.1.1.1" >> /etc/resolv.conf
|
||||
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf
|
||||
- rustup component add clippy
|
||||
- cargo clippy --all
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: arm64 [debug]
|
||||
|
||||
platform:
|
||||
arch: arm64
|
||||
|
||||
steps:
|
||||
- name: build [debug]
|
||||
image: rust:1.71.1-slim-bookworm
|
||||
commands:
|
||||
- rustc --version
|
||||
- cargo --version
|
||||
# Stupid workarounds, for stupid problems
|
||||
- echo "nameserver 1.1.1.1" >> /etc/resolv.conf
|
||||
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf
|
||||
- cargo build --all
|
||||
|
||||
- name: test [debug]
|
||||
image: rust:1.71.1-slim-bookworm
|
||||
commands:
|
||||
- rustc --version
|
||||
- cargo --version
|
||||
# Stupid workarounds, for stupid problems
|
||||
- echo "nameserver 1.1.1.1" >> /etc/resolv.conf
|
||||
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf
|
||||
- cargo test --all
|
||||
|
||||
- name: lint-clippy [debug]
|
||||
image: rust:1.71.1-slim-bookworm
|
||||
commands:
|
||||
- rustc --version
|
||||
- cargo --version
|
||||
# Stupid workarounds, for stupid problems
|
||||
- echo "nameserver 1.1.1.1" >> /etc/resolv.conf
|
||||
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf
|
||||
- rustup component add clippy
|
||||
- cargo clippy --all
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: amd64 [release]
|
||||
|
||||
platform:
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: build and test [release]
|
||||
image: rust:1.71.1-slim-bookworm
|
||||
commands:
|
||||
- rustc --version
|
||||
- cargo --version
|
||||
# Stupid workarounds, for stupid problems
|
||||
- echo "nameserver 1.1.1.1" >> /etc/resolv.conf
|
||||
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf
|
||||
- cargo test --all --release
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: arm64 [release]
|
||||
|
||||
platform:
|
||||
arch: arm64
|
||||
|
||||
steps:
|
||||
- name: build and test [release]
|
||||
image: rust:1.71.1-slim-bookworm
|
||||
commands:
|
||||
- rustc --version
|
||||
- cargo --version
|
||||
# Stupid workarounds, for stupid problems
|
||||
- echo "nameserver 1.1.1.1" >> /etc/resolv.conf
|
||||
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf
|
||||
- cargo test --all --release
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: rustfmt
|
||||
steps:
|
||||
- name: Format Project with rustfmt
|
||||
image: rust:1.71.1-alpine
|
||||
commands:
|
||||
- rustc --version
|
||||
- cargo --version
|
||||
|
||||
# Stupid workarounds, for stupid problems
|
||||
- echo "nameserver 1.1.1.1" >> /etc/resolv.conf
|
||||
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf
|
||||
- rustup component add rustfmt
|
||||
- cargo fmt --all --check && echo "No formatting required, exiting early..." && exit 0
|
||||
- cargo fmt --all --verbose
|
||||
|
||||
# Check for format loop
|
||||
- apk add git
|
||||
- '[ "$(git log -1 --pretty=%B | grep -E ".+")" = "rustfmt" ] && echo "format loop detected, aborting..." && exit 1'
|
||||
|
||||
# Get necessary packages
|
||||
- apk add openssh gpg gpg-agent
|
||||
|
||||
# configure SSH and import private key
|
||||
- mkdir -p "$${HOME}/.ssh"
|
||||
- echo "$SSH_PRIVATE_KEY" > "$${HOME}/.ssh/git"
|
||||
- echo "Host git.libre.moe" >> "$${HOME}/.ssh/config"
|
||||
- echo " User git" >> "$${HOME}/.ssh/config"
|
||||
- echo " IdentityFile $${HOME}/.ssh/git" >> "$${HOME}/.ssh/config"
|
||||
- echo "$GITEA_ED25519_SIG" >> "$${HOME}/.ssh/known_hosts"
|
||||
- echo "$GITEA_RSA_SIG" >> "$${HOME}/.ssh/known_hosts"
|
||||
- echo "$GITEA_ECDSA_SIG" >> "$${HOME}/.ssh/known_hosts"
|
||||
- chmod 700 -R "$${HOME}/.ssh"
|
||||
|
||||
# setup gpg
|
||||
- gpg-agent --daemon
|
||||
# the git config gpg.program absolutely despises anything other than a path, including additional arguments.
|
||||
# so we just put it into it's own shell script and use that later
|
||||
- echo "#!/bin/sh" >> /tmp/gpg.sh
|
||||
- echo gpg --batch --pinentry-mode loopback --passphrase '$GPG_PASSPHRASE' \$@ >> /tmp/gpg.sh
|
||||
- chmod 777 /tmp/gpg.sh
|
||||
|
||||
# import gpg key
|
||||
- echo "$GPG_PRIVKEY" > /tmp/private.key
|
||||
- /tmp/gpg.sh --import /tmp/private.key >> /tmp/import.sh || exit 2
|
||||
|
||||
# configure git
|
||||
- git config --local user.name "WANessa"
|
||||
- git config --local user.email "$GIT_EMAIL_ADDRESS"
|
||||
- git config --local user.signingkey "$GPG_PUBKEY_ID"
|
||||
- git config --local gpg.program "/tmp/gpg.sh" # see above comment
|
||||
# Uncomment below line for ssh debugging
|
||||
# - git config core.sshCommand '/usr/bin/ssh -v'
|
||||
- git remote add ssh "$DRONE_GIT_SSH_URL"
|
||||
|
||||
# commit and push every modified file, does not include new files, because why should it?
|
||||
- GIT_COMMITTER_NAME="WANessa" GIT_COMMITTER_EMAIL="$GIT_EMAIL_ADDRESS" git commit --author "$DRONE_COMMIT_AUTHOR_NAME <$DRONE_COMMIT_AUTHOR_EMAIL>" -S -a -m "rustfmt"
|
||||
- git push ssh
|
||||
|
||||
environment:
|
||||
SSH_PRIVATE_KEY:
|
||||
from_secret: WANESSA_SSH_PRIVKEY
|
||||
GIT_EMAIL_ADDRESS:
|
||||
from_secret: WANESSA_EMAIL_ADDRESS
|
||||
GITEA_ED25519_SIG:
|
||||
from_secret: GIT_ED25519_SIG
|
||||
GITEA_RSA_SIG:
|
||||
from_secret: GIT_RSA_SIG
|
||||
GITEA_ECDSA_SIG:
|
||||
from_secret: GIT_ECDSA_SIG
|
||||
GPG_PUBKEY_ID:
|
||||
from_secret: WANESSA_GPG_PUBKEY_ID
|
||||
GPG_PASSPHRASE:
|
||||
from_secret: WANESSA_GPG_PASSPHRASE
|
||||
GPG_PRIVKEY:
|
||||
from_secret: WANESSA_GPG_PRIVKEY
|
||||
|
||||
depends_on:
|
||||
- amd64 [debug]
|
||||
- arm64 [debug]
|
||||
- amd64 [release]
|
||||
- arm64 [release]
|
||||
|
14
Cargo.toml
14
Cargo.toml
@ -1,8 +1,20 @@
|
||||
[package]
|
||||
name = "WANessa"
|
||||
name = "wanessa"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
|
||||
[lints.rust]
|
||||
unsafe_code = "forbid"
|
||||
|
||||
[lints.clippy]
|
||||
enum_glob_use = "deny" # https://rust-lang.github.io/rust-clippy/master/index.html#/enum_glob_use
|
||||
pedantic = "deny" # https://rust-lang.github.io/rust-clippy/master/index.html#/?groups=pedantic
|
||||
nursery = "deny" # wip lints: https://rust-lang.github.io/rust-clippy/master/index.html#/?groups=nursery
|
||||
unwrap_used = "deny" # https://rust-lang.github.io/rust-clippy/master/index.html#/unwrap_used
|
||||
missing_const_for_fn = "warn" # https://rust-lang.github.io/rust-clippy/master/index.html#/missing_const_for_fn
|
||||
missing_assert_message = "deny" # https://rust-lang.github.io/rust-clippy/master/index.html#/missing_assert_message
|
||||
missing_errors_doc = "deny" # https://rust-lang.github.io/rust-clippy/master/index.html#/missing_assert_message
|
1
rustfmt.toml
Normal file
1
rustfmt.toml
Normal file
@ -0,0 +1 @@
|
||||
hard_tabs = true
|
@ -1,3 +1,3 @@
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
println!("Hello, world!");
|
||||
}
|
||||
|
Reference in New Issue
Block a user