Skip to content

Commit

Permalink
cache
Browse files Browse the repository at this point in the history
  • Loading branch information
ChuckHend committed Jul 31, 2023
1 parent 5da31e4 commit ba7fa88
Showing 1 changed file with 27 additions and 10 deletions.
37 changes: 27 additions & 10 deletions .github/workflows/extension_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,14 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2

# rust needed to install trunk
- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "pg-vectorize-extension-test"
workspaces: pg-vectorize
# Additional directories to cache
cache-directories: /home/runner/.pgrx

- name: Install stoml and pg-trunk
shell: bash
run: |
Expand All @@ -41,6 +39,16 @@ jobs:
sudo mv stoml /usr/local/bin/
cargo install pg-trunk
- name: Cache binaries
uses: actions/cache@v2
with:
path: |
/usr/local/bin/stoml
~/.cargo/bin/trunk
key: ${{ runner.os }}-bins-${{ github.sha }}
restore-keys: |
${{ runner.os }}-bins-
lint:
name: Run linters
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -85,14 +93,23 @@ jobs:
- uses: ./.github/actions/pgx-init
with:
working-directory: ./
- name: Restore cached binaries
uses: actions/cache@v2
with:
path: |
/usr/local/bin/stoml
~/.cargo/bin/trunk
key: ${{ runner.os }}-mybins-${{ github.sha }}
restore-keys: |
${{ runner.os }}-mybins-
- name: test
run: |
pgrx15_config=$(stoml ~/.pgrx/config.toml configs.pg15)
trunk install pgvector --pg-config ${pgrx15_config}
trunk install pgmq --pg-config ${pgrx15_config}
trunk install pg_cron --pg-config ${pgrx15_config}
pgrx15_config=$(/usr/local/bin/stoml ~/.pgrx/config.toml configs.pg15)
~/.cargo/bin/trunk install pgvector --pg-config ${pgrx15_config}
~/.cargo/bin/trunk install pgmq --pg-config ${pgrx15_config}
~/.cargo/bin/trunk install pg_cron --pg-config ${pgrx15_config}
rm -rf ./target/pgrx-test-data-* || true
pg_version=$(stoml Cargo.toml features.default)
pg_version=$(/usr/local/bin/stoml Cargo.toml features.default)
cargo pgrx run ${pg_version} --pgcli || true
cargo pgrx test ${pg_version}
Expand Down

0 comments on commit ba7fa88

Please sign in to comment.