Update actions
This commit is contained in:
parent
eb410e1e0f
commit
505589e9e9
3 changed files with 10 additions and 27 deletions
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
|
@ -11,8 +11,7 @@ on:
|
|||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
# This workflow contains a single job called "build"
|
||||
test:
|
||||
build:
|
||||
# The type of runner that the job will run on
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
|
@ -40,4 +39,9 @@ jobs:
|
|||
|
||||
- name: shellcheck
|
||||
run: shellcheck backup.sh
|
||||
|
||||
|
||||
- name: Build the Docker image
|
||||
run: |
|
||||
echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
|
||||
docker build . --file Dockerfile --tag ghcr.io/nicolaschan/minecraft-backup:$GITHUB_SHA
|
||||
docker push ghcr.io/nicolaschan/minecraft-backup:$GITHUB_SHA
|
||||
|
|
21
.github/workflows/docker-image.yml
vendored
21
.github/workflows/docker-image.yml
vendored
|
@ -1,21 +0,0 @@
|
|||
name: Docker Image CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build the Docker image
|
||||
run: |
|
||||
echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
|
||||
docker build . --file Dockerfile --tag ghcr.io/nicolaschan/minecraft-backup:$GITHUB_SHA
|
||||
docker push ghcr.io/nicolaschan/minecraft-backup:$GITHUB_SHA
|
|
@ -295,9 +295,10 @@ test-thinning-delete () {
|
|||
test-thinning-delete-long () {
|
||||
for i in $(seq 0 99); do
|
||||
TIMESTAMP="$(date +%F_%H-%M-%S --date="2021-01-01 +$i day")"
|
||||
OUTPUT="$(./backup.sh -v -i "$TEST_TMP/server/world" -o "$TEST_TMP/backups" -s "$SCREEN_TMP" -f "$TIMESTAMP")"
|
||||
OUTPUT="$(./backup.sh -v -m 73 -i "$TEST_TMP/server/world" -o "$TEST_TMP/backups" -s "$SCREEN_TMP" -f "$TIMESTAMP")"
|
||||
done
|
||||
UNEXPECTED_TIMESTAMPS=(
|
||||
"2021-01-04_00-00-00"
|
||||
"2021-01-05_00-00-00"
|
||||
"2021-01-12_00-00-00"
|
||||
"2021-01-24_00-00-00"
|
||||
|
@ -305,10 +306,9 @@ test-thinning-delete-long () {
|
|||
for TIMESTAMP in "${UNEXPECTED_TIMESTAMPS[@]}"; do
|
||||
assertFalse '[ -f '"$TEST_TMP/backups/$TIMESTAMP.tar.gz"' ]'
|
||||
done
|
||||
assertEquals 74 "$(find "$TEST_TMP/backups" -type f | wc -l)"
|
||||
assertEquals 73 "$(find "$TEST_TMP/backups" -type f | wc -l)"
|
||||
EXPECTED_TIMESTAMPS=(
|
||||
# Weekly
|
||||
"2021-01-04_00-00-00"
|
||||
"2021-01-11_00-00-00"
|
||||
"2021-01-25_00-00-00"
|
||||
"2021-01-25_00-00-00"
|
||||
|
|
Loading…
Add table
Reference in a new issue