Skip to content

Commit

Permalink
github actions check.yml docker magic
Browse files Browse the repository at this point in the history
  • Loading branch information
david-littlefarmer committed Dec 20, 2023
1 parent 0bf66f2 commit 29894f8
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,29 @@ jobs:
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- "5432:5432"
volumes:
- ${{ github.workspace }}/temp/db.sh:/home/db.sh
- ${{ github.workspace }}/temp/schema.sql:/home/schema.sql

steps:
- name: Git clone
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
clean: 'false'
ref: ${{ github.event.pull_request.head.sha }} # Checkout Pull Request HEAD commit instead of the default Pull Request merge commit.
fetch-depth: 1

- name: Copy schema and db
run: |
mkdir -p temp
cp ./scripts/backend/db.sh ./temp/db.sh
cp ./db/schema/schema.sql ./temp/schema.sql
- name: Restart postgres
uses: docker://docker
with:
args: docker restart postgres

- name: Git safe.directory
# Fixes following git error:
# error obtaining VCS status: exit status 128
Expand All @@ -49,4 +66,4 @@ jobs:
if [[ $(git ls-files | xargs du -hs --threshold=2M 2>/dev/null | tee /dev/stderr | wc -l) -gt 0 ]]; then
echo "Aborting due to big files in the git repository."
exit 1;
fi
f/db.shi

0 comments on commit 29894f8

Please sign in to comment.