From 1d3c439b654fa1d5400ccaf318d8b0ff8a051a1d Mon Sep 17 00:00:00 2001 From: "Fco. Javier Delgado del Hoyo" Date: Mon, 9 Dec 2024 12:32:31 +0100 Subject: [PATCH] split test and build jobs --- .github/workflows/{image.yml => build.yml} | 22 +----------------- .github/workflows/test.yml | 26 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 21 deletions(-) rename .github/workflows/{image.yml => build.yml} (59%) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/image.yml b/.github/workflows/build.yml similarity index 59% rename from .github/workflows/image.yml rename to .github/workflows/build.yml index 5827146..fab409a 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..4460983 --- /dev/null +++ b/.github/workflows/test.yml @@ -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