Skip to content

Update docker Docker tag to v24.0.7 #69

Update docker Docker tag to v24.0.7

Update docker Docker tag to v24.0.7 #69

name: Tests
on:
workflow_dispatch: # Allow manually running
workflow_call: # Allow another workflow to call this one
pull_request:
types:
- opened
- reopened
- edited
- synchronize
branches: # Target
- 'main'
- 'dev'
# push:
# branches:
# - 'main'
# - 'codecov'
# tags:
# - 'v*'
jobs:
unit_test_and_coverage:
name: Unit tests and coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: head
- name: Install Ruby dependencies
run: |
gem install bashcov simplecov-cobertura simplecov-html
- name: Run unit tests
run: bashcov ./tests/tests.sh && ls -la coverage
- name: Upload reports to Codecov
uses: codecov/codecov-action@v4-beta
# uses: codecov/codecov-action@v3
env: # Required for v4
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
fail_ci_if_error: true
files: coverage/coverage.xml # The json file will not work here
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage
path: coverage/
retention-days: 5
test_docker_image:
name: Docker image tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate Dockerfile supports multi-arch
run: |
echo "Checking if the base docker image supports amd64 and arm64..."
bash ./tests/validate_dockerfile.sh
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and export Docker image
uses: docker/build-push-action@v5
with:
context: .
load: true # Do not push this image
tags: minituff/nautical-backup:test
- name: Run integation tests against Docker image
run: |
cd tests
docker compose run nautical-backup-test1 --exit-code-from nautical-backup-test1
docker compose run nautical-backup-test2 --exit-code-from nautical-backup-test2