Skip to content

Change order of chmod to allow files check in on windows to run #84

Change order of chmod to allow files check in on windows to run

Change order of chmod to allow files check in on windows to run #84

Workflow file for this run

name: CI-dev-pipeline
on:
push:
branches: [ master ]
tags:
- 'v*'
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- FLAVOR: 12
- FLAVOR: 15
container:
image: lucasalt/act_base:latest
env:
POSTGRES_BASE_IMAGE: postgres:${{ matrix.FLAVOR }}-alpine
S3_HOST: s3${{ matrix.FLAVOR }}
AWS_CLI_HOST: aws${{ matrix.FLAVOR }}
S3_ACCESS_KEY_ID: myawskey
S3_SECRET_ACCESS_KEY: myawssecret
S3_ENDPOINT: http://s3${{ matrix.FLAVOR }}:9000
S3_BUCKET: my-bucket
POSTGRES_USER: pg
POSTGRES_PASSWORD: pw
POSTGRES_DATABASE: test_db
POSTGRES_PORT: '5432'
POSTGRES_HOST: postgres${{ matrix.FLAVOR }}
POSTGRES_BACKUP_HOST: postgres-backup-s3-${{ matrix.FLAVOR }}
POSTGRES_BACKUP_IMAGE: postgres-backup-s3-${{ matrix.FLAVOR }}
POSTGRES_CLIENT_IMAGE: richardwiden/postgresql-client:edge-${{ matrix.FLAVOR }}
POSTGRES_VOLUME: pgdata-${{ matrix.FLAVOR }}
TEST_NETWORK: test-network-${{ matrix.FLAVOR }}
ENCRYPTION_PASSWORD: 'encryption_password'
steps:
- uses: actions/checkout@v4
- name: Chmod test-files (windows fix)
run: chmod -R +x ./test
- name: CLEANUP PREVIOUS RUNS
run: ./test/tear_down.sh
- name: BACKUP_RESTORE - setup
run: ./test/setup.sh
- name: BACKUP_RESTORE - backup
run: ./test/test_backup.sh
- name: BACKUP_RESTORE - restore
run: ./test/test_restore.sh
env:
RESTORE: "latest"
- name: BACKUP_RESTORE - teardown
run: ./test/tear_down.sh
- name: BACKUP_SCHEDULE - setup
run: ./test/setup.sh
- name: BACKUP_SCHEDULE - backup
run: ./test/test_backup_schedule.sh
env:
SCHEDULE: "@every 5s"
DELETE_OLDER_THAN: "15 seconds ago"
- name: BACKUP_SCHEDULE - restore
run: ./test/test_restore.sh
env:
RESTORE: "latest"
- name: BACKUP_SCHEDULE - teardown
run: ./test/tear_down.sh
- name: LOGIN_ERROR - setup
run: ./test/setup.sh
- name: LOGIN_ERROR - backup
run: ./test/test_backup.sh
- name: LOGIN_ERROR - restore (should fail)
run: ./test/test_error_from_aws.sh
env:
RESTORE: "latest"
S3_SECRET_ACCESS_KEY: "WRONG_KEY"
- name: LOGIN_ERROR - teardown
run: ./test/tear_down.sh
deploy:
if: ${{ !github.event.act }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- postgres_version: 12
suffix: ""
- postgres_version: 14
suffix: "-14"
- postgres_version: 15
suffix: "-15"
steps:
- uses: actions/checkout@v4
- name: Release
if: ${{ !env.ACT && matrix.postgres_version == 12 }}
uses: crowbarmaster/GH-Automatic-Releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
title: "Development Build"
files: |
README.md
- name: Log in to Docker Hub
if: ${{ !env.ACT }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
if: ${{ !env.ACT }}
id: meta
uses: docker/metadata-action@v5
with:
flavor: |
latest=auto
suffix=${{ matrix.suffix }}
tags: |
type=semver,pattern={{version}},suffix=${{ matrix.suffix }}
type=semver,pattern={{major}}.{{minor}},suffix=${{ matrix.suffix }}
type=semver,pattern={{major}},suffix=${{ matrix.suffix }}
type=edge,enable=true,suffix=${{ matrix.suffix }}
images: richardwiden/postgresql-backup-s3
- name: Set up Docker Buildx
if: ${{ !env.ACT }}
id: buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
if: ${{ !env.ACT }}
uses: docker/build-push-action@v5
with:
context: docker
push: true
build-args: "POSTGRES_BASE_IMAGE=postgres:${{matrix.postgres_version}}-alpine"
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Update repo description
if: ${{ !env.ACT && matrix.suffix == "" }}

Check failure on line 147 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / CI-dev-pipeline

Invalid workflow file

The workflow is not valid. .github/workflows/build.yml (Line: 147, Col: 13): Unexpected symbol: '""'. Located at position 30 within expression: !env.ACT && matrix.suffix == ""
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: richardwiden/postgresql-backup-s3
readme-filepath: ./README.md