diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index fec1e73..a245cf6 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -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 @@ -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