auto-format #20

Merged
leon merged 143 commits from auto-format into main 2024-02-14 01:18:02 +01:00
2 changed files with 76 additions and 20 deletions

View File

@ -27,14 +27,6 @@ steps:
- rustup component add clippy - rustup component add clippy
- cargo clippy --verbose --all - cargo clippy --verbose --all
- name: format [debug]
image: rust:1.71.1-slim-bookworm
commands:
- rustc --version
- cargo --version
- rustup component add rustfmt
- cargo fmt --verbose --all --check
--- ---
kind: pipeline kind: pipeline
name: arm64 [debug] name: arm64 [debug]
@ -74,17 +66,6 @@ steps:
- rustup component add clippy - rustup component add clippy
- cargo clippy --verbose --all - cargo clippy --verbose --all
- name: format [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 rustfmt
- cargo fmt --verbose --all --check
--- ---
kind: pipeline kind: pipeline
name: amd64 [release] name: amd64 [release]
@ -116,4 +97,79 @@ steps:
# Stupid workarounds, for stupid problems # Stupid workarounds, for stupid problems
- echo "nameserver 1.1.1.1" >> /etc/resolv.conf - echo "nameserver 1.1.1.1" >> /etc/resolv.conf
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf - echo "nameserver 1.0.0.1" >> /etc/resolv.conf
- cargo test --verbose --all --release - cargo test --verbose --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
- apk add git
- '[ "$(git log -1 --pretty=%B | grep -E ".+")" = "rustfmt" ] && echo "format loop detected, aborting..." && exit 1'
- apk update
- apk add openssh gpg gpg-agent
- 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"
- gpg-agent --daemon
- echo "$GPG_PRIVKEY" > /tmp/private.key
- gpg --batch --pinentry-mode loopback --passphrase '$GPG_PASSPHRASE' --import /tmp/private.key >> /tmp/import.sh || exit 2
- echo "#!/bin/sh" >> /tmp/gpg.sh
- echo gpg --batch --pinentry-mode loopback --passphrase '$GPG_PASSPHRASE' \$@ >> /tmp/gpg.sh
- chmod 777 /tmp/gpg.sh
- 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"
# Uncomment below line for ssh debugging
# - git config core.sshCommand '/usr/bin/ssh -v'
- git remote add ssh "$DRONE_GIT_SSH_URL"
- 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" ; cat /tmp/log #|| exit 3
- 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]

0
test Normal file
View File