You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.2 KiB
YAML

# This workflow doesn't support cache invalidation for unused dependencies at the moment
kind: pipeline
type: ssh
name: Build on M1
environment:
CARGO_TERM_COLOR: always
server:
host:
from_secret: host
user:
from_secret: user
password:
from_secret: password
steps:
Improve reliability, simplicity and recoverability of BGSAVE (#153) * Create a new file on writing to flock-ed file This fix is a very important one in two ways. Say we have an user A. They go ahead and launch skyd. skyd creates a data.bin file. Now A just deletes the data.bin file for fun. Funny enough, this never causes flock to error! Why? Well because the descriptor/handle is still valid and was just unlinked from the current directory. But this might seem silly since the user exits with a 'successfully saved notice' only to find that the file never existed and all of their data was lost. That's bad. There's a hidden problem in our current approach too, apart from this. Our writing process begins by truncating the old file and then writing to it by placing the cursor at 0. Nice, but what if this operation just crashes. So we lost the current data AND the old data. Not good. This commit does a better thing: it creates a new temporary file, locks it before writing and then flushes the current data to the temporary file. Once that succeeds, it replaces the old data.bin file with the newly created file. This solves both the problems mentioned here for us: 1. No more of the silly error 2. If BGSAVE crashes in between, we can be sure that at least the last data.bin file is in proper shape and not half truncated or so. This commit further moves the background services into their own module(s) for easy management. * Fix CI scripts Fixes: 1. Our custom runner (drone/.ci.yml) was modified to kill the skyd process once done since this pipeline is not ephemeral. 2. GHA for some reason ignores any error in the test step and proceeds to kill the skyd process without erroring. Since GHA runners are ephemeral, we don't need to do this manually.
3 years ago
- name: Update rust
commands:
- /usr/local/bin/rustup-update
- name: Run tests
environment:
SRCENV:
from_secret: srcenv
CARGO_HOME:
from_secret: cargohome
commands:
- source $SRCENV/.cargo/env
- export RUSTUP_HOME=$SRCENV/.rustup
- make test
when:
event:
exclude:
- tag
- name: Build bundle
environment:
SRCENV:
from_secret: srcenv
CARGO_HOME:
from_secret: cargohome
TARGET: aarch64-apple-darwin
VERSION: ${DRONE_TAG}
ARTIFACT: aarch64-apple-darwin
TOOLDIR:
from_secret: tooldir
GITHUB_TOKEN:
from_secret: github_token
commands:
- source $SRCENV/.cargo/env
- export RUSTUP_HOME=$SRCENV/.rustup
- make bundle
- $TOOLDIR/hub release edit $($TOOLDIR/gfind . -type f -name "*.zip" -printf "-a %p ") -m "" "$VERSION"
when:
event:
- tag