Skip to content

Commit

Permalink
split test and build jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Fco. Javier Delgado del Hoyo authored and Fco. Javier Delgado del Hoyo committed Dec 9, 2024
1 parent 8a15e59 commit 1d3c439
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 21 deletions.
22 changes: 1 addition & 21 deletions .github/workflows/image.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,14 @@

name: build docker image

on:
workflow_dispatch:
push:
branches:
- "**"
tags:
- "**"

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:
runs-on: ubuntu-22.04
needs: test
steps:
- name: Checkout the code
uses: actions/checkout@v4
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1d3c439

Please sign in to comment.