Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lucemans committed Dec 4, 2024
1 parent 4b05228 commit b217cbf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
28 changes: 24 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@ jobs:
with:
fetch-depth: 0

- name: Cache Cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache Cargo build
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
with:
Expand All @@ -37,11 +53,16 @@ jobs:

- name: Migrate db
working-directory: ./engine
run: cargo install sqlx-cli --no-default-features --features native-tls,postgres && sqlx migrate run
run: cargo install sqlx-cli --no-default-features --features native-tls,postgres && sqlx migrate run && sqlx migrate prepare


- name: Build
- name: Stop postgres via docker-compose dev
working-directory: ./engine
run: sqlx migrate run
run: docker compose -f ./compose.yaml down

# - name: Build
# working-directory: ./engine
# run: cargo build --release

- name: Build docker image using github actions
uses: docker/build-push-action@v5
Expand All @@ -52,4 +73,3 @@ jobs:
push: false
build-args: |
BINARY_NAME=v3x-property-engine
DATABASE_URL=postgres://postgres:postgres@${{ env.RUNNER_IP }}:5432/postgres
1 change: 1 addition & 0 deletions engine/.build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ RUN ["/bin/bash", "-c", "set -x && rm target/x86_64-unknown-linux-musl/release/d
# Now add the rest of the project and build the real main
COPY src ./src
COPY migrations ./migrations
COPY .sqlx ./sqlx

RUN echo "DATABASE_URL=$DATABASE_URL"

Expand Down

0 comments on commit b217cbf

Please sign in to comment.