mirror of
https://github.com/fradelg/docker-mysql-cron-backup.git
synced 2025-01-18 08:12:34 +01:00
split test and build jobs
This commit is contained in:
parent
8a15e59c1f
commit
1d3c439b65
2 changed files with 27 additions and 21 deletions
|
@ -1,34 +1,14 @@
|
||||||
|
|
||||||
name: build docker image
|
name: build docker image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
push:
|
||||||
branches:
|
|
||||||
- "**"
|
|
||||||
tags:
|
tags:
|
||||||
- "**"
|
- "**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
steps:
|
|
||||||
- name: Checkout the code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Test Bash scripts
|
|
||||||
run: sudo apt-get -qq update && sudo apt-get install -y devscripts shellcheck && make test
|
|
||||||
- name: Test image
|
|
||||||
env:
|
|
||||||
VOLUME_PATH: /tmp/mariadb
|
|
||||||
DATABASE_NAME: foo
|
|
||||||
MARIADB_ROOT_PASSWORD: abcd
|
|
||||||
run: |
|
|
||||||
docker compose up -d mariadb
|
|
||||||
docker compose run backup /backup.sh
|
|
||||||
docker compose run backup /restore.sh /backup/latest.foo.sql.gz
|
|
||||||
docker compose stop
|
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
needs: test
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the code
|
- name: Checkout the code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
26
.github/workflows/test.yml
vendored
Normal file
26
.github/workflows/test.yml
vendored
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
name: build docker image
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout the code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Test Bash scripts
|
||||||
|
run: sudo apt-get -qq update && sudo apt-get install -y devscripts shellcheck && make test
|
||||||
|
- name: Test image
|
||||||
|
env:
|
||||||
|
VOLUME_PATH: /tmp/mariadb
|
||||||
|
DATABASE_NAME: foo
|
||||||
|
MARIADB_ROOT_PASSWORD: abcd
|
||||||
|
run: |
|
||||||
|
docker compose up -d mariadb
|
||||||
|
docker compose run backup /backup.sh
|
||||||
|
docker compose run backup /restore.sh /backup/latest.foo.sql.gz
|
||||||
|
docker compose stop
|
Loading…
Reference in a new issue