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 92d0eff
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
28 changes: 26 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,36 @@ 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
- ${{ github.workspace }}/temp:/home
options: --name skeleton-postgres

steps:

- name: Git clone
run: |
sudo chown -R $USER:$USER /home/runner/work/skeleton
- 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.sql ./temp/schema.sql
- name: Restart postgres
uses: docker://docker
with:
args: docker restart skeleton-postgres

- name: Git safe.directory
# Fixes following git error:
# error obtaining VCS status: exit status 128
Expand All @@ -49,4 +73,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
2 changes: 1 addition & 1 deletion etc/ci.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ environment = "test"
conn_max_lifetime = "1800s"
connect_timeout = 5
database = "skeleton_e2e"
host = "postgres:5432"
host = "skeleton-postgres:5432"
max_idle_conns = 10
max_open_conns = 100
read_only = false
Expand Down

0 comments on commit 92d0eff

Please sign in to comment.