split test and build jobs

This commit is contained in:
Fco. Javier Delgado del Hoyo 2024-12-09 12:32:31 +01:00
parent 8a15e59c1f
commit 1d3c439b65
2 changed files with 27 additions and 21 deletions

View file

@ -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
View 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