2024-01-13 21:35:42 +01:00
|
|
|
kind: pipeline
|
|
|
|
name: amd64 [debug]
|
|
|
|
|
|
|
|
platform:
|
|
|
|
arch: amd64
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: build [debug]
|
2024-02-09 21:26:45 +01:00
|
|
|
image: rust:1.71.1-slim-bookworm
|
2024-01-13 21:35:42 +01:00
|
|
|
commands:
|
|
|
|
- rustc --version
|
|
|
|
- cargo --version
|
2024-02-15 08:04:37 +01:00
|
|
|
# Stupid workarounds, for stupid problems
|
|
|
|
- echo "nameserver 1.1.1.1" >> /etc/resolv.conf
|
|
|
|
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf
|
2024-02-15 02:53:19 +01:00
|
|
|
- cargo build --all
|
2024-01-13 21:35:42 +01:00
|
|
|
|
|
|
|
- name: test [debug]
|
2024-02-09 21:26:45 +01:00
|
|
|
image: rust:1.71.1-slim-bookworm
|
2024-01-13 21:35:42 +01:00
|
|
|
commands:
|
|
|
|
- rustc --version
|
|
|
|
- cargo --version
|
2024-02-15 08:04:37 +01:00
|
|
|
# Stupid workarounds, for stupid problems
|
|
|
|
- echo "nameserver 1.1.1.1" >> /etc/resolv.conf
|
|
|
|
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf
|
2024-02-15 02:53:19 +01:00
|
|
|
- cargo test --all
|
2024-01-13 21:35:42 +01:00
|
|
|
|
2024-02-09 21:26:45 +01:00
|
|
|
- name: lint-clippy [debug]
|
2024-02-13 01:11:37 +01:00
|
|
|
image: rust:1.71.1-slim-bookworm
|
2024-02-09 21:26:45 +01:00
|
|
|
commands:
|
|
|
|
- rustc --version
|
|
|
|
- cargo --version
|
2024-02-15 08:04:37 +01:00
|
|
|
# Stupid workarounds, for stupid problems
|
|
|
|
- echo "nameserver 1.1.1.1" >> /etc/resolv.conf
|
|
|
|
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf
|
2024-02-09 21:26:45 +01:00
|
|
|
- rustup component add clippy
|
2024-02-15 02:53:19 +01:00
|
|
|
- cargo clippy --all
|
2024-02-09 21:26:45 +01:00
|
|
|
|
2024-01-13 21:35:42 +01:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
name: arm64 [debug]
|
|
|
|
|
|
|
|
platform:
|
|
|
|
arch: arm64
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: build [debug]
|
2024-02-09 21:26:45 +01:00
|
|
|
image: rust:1.71.1-slim-bookworm
|
2024-01-13 21:35:42 +01:00
|
|
|
commands:
|
|
|
|
- rustc --version
|
|
|
|
- cargo --version
|
2024-02-13 01:01:35 +01:00
|
|
|
# Stupid workarounds, for stupid problems
|
|
|
|
- echo "nameserver 1.1.1.1" >> /etc/resolv.conf
|
|
|
|
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf
|
2024-02-15 02:53:19 +01:00
|
|
|
- cargo build --all
|
2024-01-13 21:35:42 +01:00
|
|
|
|
|
|
|
- name: test [debug]
|
2024-02-09 21:26:45 +01:00
|
|
|
image: rust:1.71.1-slim-bookworm
|
2024-01-13 21:35:42 +01:00
|
|
|
commands:
|
|
|
|
- rustc --version
|
|
|
|
- cargo --version
|
2024-02-13 01:01:35 +01:00
|
|
|
# Stupid workarounds, for stupid problems
|
|
|
|
- echo "nameserver 1.1.1.1" >> /etc/resolv.conf
|
|
|
|
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf
|
2024-02-15 02:53:19 +01:00
|
|
|
- cargo test --all
|
2024-01-13 21:35:42 +01:00
|
|
|
|
2024-02-09 21:26:45 +01:00
|
|
|
- name: lint-clippy [debug]
|
2024-02-13 01:11:37 +01:00
|
|
|
image: rust:1.71.1-slim-bookworm
|
2024-02-09 21:26:45 +01:00
|
|
|
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
|
2024-02-15 02:53:19 +01:00
|
|
|
- cargo clippy --all
|
2024-02-09 21:26:45 +01:00
|
|
|
|
2024-01-13 21:35:42 +01:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
name: amd64 [release]
|
|
|
|
|
|
|
|
platform:
|
|
|
|
arch: amd64
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: build and test [release]
|
2024-02-09 21:26:45 +01:00
|
|
|
image: rust:1.71.1-slim-bookworm
|
2024-01-13 21:35:42 +01:00
|
|
|
commands:
|
|
|
|
- rustc --version
|
|
|
|
- cargo --version
|
2024-02-15 08:04:37 +01:00
|
|
|
# Stupid workarounds, for stupid problems
|
|
|
|
- echo "nameserver 1.1.1.1" >> /etc/resolv.conf
|
|
|
|
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf
|
2024-02-15 02:53:19 +01:00
|
|
|
- cargo test --all --release
|
2024-01-13 21:35:42 +01:00
|
|
|
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
name: arm64 [release]
|
|
|
|
|
|
|
|
platform:
|
|
|
|
arch: arm64
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: build and test [release]
|
2024-02-09 21:26:45 +01:00
|
|
|
image: rust:1.71.1-slim-bookworm
|
2024-01-13 21:35:42 +01:00
|
|
|
commands:
|
|
|
|
- rustc --version
|
|
|
|
- cargo --version
|
2024-02-13 01:01:35 +01:00
|
|
|
# Stupid workarounds, for stupid problems
|
|
|
|
- echo "nameserver 1.1.1.1" >> /etc/resolv.conf
|
|
|
|
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf
|
2024-02-15 02:53:19 +01:00
|
|
|
- cargo test --all --release
|
2024-02-14 01:18:01 +01:00
|
|
|
|
|
|
|
---
|
|
|
|
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
|
|
|
|
|
2024-02-14 01:26:33 +01:00
|
|
|
# Check for format loop
|
2024-02-14 01:18:01 +01:00
|
|
|
- apk add git
|
|
|
|
- '[ "$(git log -1 --pretty=%B | grep -E ".+")" = "rustfmt" ] && echo "format loop detected, aborting..." && exit 1'
|
|
|
|
|
2024-02-14 01:26:33 +01:00
|
|
|
# Get necessary packages
|
2024-02-14 01:18:01 +01:00
|
|
|
- apk add openssh gpg gpg-agent
|
|
|
|
|
2024-02-14 01:26:33 +01:00
|
|
|
# configure SSH and import private key
|
2024-02-14 01:18:01 +01:00
|
|
|
- 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"
|
|
|
|
|
2024-02-14 01:26:33 +01:00
|
|
|
# setup gpg
|
2024-02-14 01:18:01 +01:00
|
|
|
- gpg-agent --daemon
|
2024-02-14 01:22:33 +01:00
|
|
|
# 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
|
2024-02-14 01:18:01 +01:00
|
|
|
- echo "#!/bin/sh" >> /tmp/gpg.sh
|
|
|
|
- echo gpg --batch --pinentry-mode loopback --passphrase '$GPG_PASSPHRASE' \$@ >> /tmp/gpg.sh
|
|
|
|
- chmod 777 /tmp/gpg.sh
|
|
|
|
|
2024-02-14 01:26:33 +01:00
|
|
|
# import gpg key
|
2024-02-14 01:22:33 +01:00
|
|
|
- echo "$GPG_PRIVKEY" > /tmp/private.key
|
|
|
|
- /tmp/gpg.sh --import /tmp/private.key >> /tmp/import.sh || exit 2
|
|
|
|
|
2024-02-14 01:26:33 +01:00
|
|
|
# configure git
|
2024-02-14 01:18:01 +01:00
|
|
|
- git config --local user.name "WANessa"
|
|
|
|
- git config --local user.email "$GIT_EMAIL_ADDRESS"
|
|
|
|
- git config --local user.signingkey "$GPG_PUBKEY_ID"
|
2024-02-14 01:22:33 +01:00
|
|
|
- git config --local gpg.program "/tmp/gpg.sh" # see above comment
|
2024-02-14 01:18:01 +01:00
|
|
|
# Uncomment below line for ssh debugging
|
|
|
|
# - git config core.sshCommand '/usr/bin/ssh -v'
|
|
|
|
- git remote add ssh "$DRONE_GIT_SSH_URL"
|
|
|
|
|
2024-02-14 01:26:33 +01:00
|
|
|
# commit and push every modified file, does not include new files, because why should it?
|
2024-02-14 01:22:33 +01:00
|
|
|
- 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"
|
2024-02-14 01:18:01 +01:00
|
|
|
- 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]
|
2024-02-15 02:53:19 +01:00
|
|
|
- arm64 [release]
|