Skip to content

Commit

Permalink
only cache cargo-pgx-init artifacts (ie, the built postgres versions)
Browse files Browse the repository at this point in the history
  • Loading branch information
eeeebbbbrrrr committed Jan 12, 2021
1 parent a5091f3 commit 319e3f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 35 deletions.
35 changes: 12 additions & 23 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,6 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: cache cargo artifacts
id: cargo-artifacts-cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/cargo-pgx
target
key: examples-${{ matrix.os }}-${{ matrix.version }}-cargo-${{ hashFiles('~/work/pgx/pgx/**/Cargo.toml') }}

- name: cache cargo pgx init
id: cargo-pgx-init-cache
uses: actions/cache@v2
Expand Down Expand Up @@ -64,37 +53,37 @@ jobs:
run: cd /tmp/ && cargo pgx new sample

- name: arrays example
run: cd pgx-examples/arrays && CARGO_TARGET_DIR=~/.cargo/cargo-pgx cargo pgx test pg${{ matrix.version }}
run: cd pgx-examples/arrays cargo pgx test pg${{ matrix.version }}

- name: bad_ideas example
run: cd pgx-examples/bad_ideas && CARGO_TARGET_DIR=~/.cargo/cargo-pgx cargo pgx test pg${{ matrix.version }}
run: cd pgx-examples/bad_ideas cargo pgx test pg${{ matrix.version }}

- name: bgworker example
run: cd pgx-examples/bgworker && CARGO_TARGET_DIR=~/.cargo/cargo-pgx cargo pgx test pg${{ matrix.version }}
run: cd pgx-examples/bgworker cargo pgx test pg${{ matrix.version }}

- name: bytea example
run: cd pgx-examples/bytea && CARGO_TARGET_DIR=~/.cargo/cargo-pgx cargo pgx test pg${{ matrix.version }}
run: cd pgx-examples/bytea cargo pgx test pg${{ matrix.version }}

- name: custom_types example
run: cd pgx-examples/custom_types && CARGO_TARGET_DIR=~/.cargo/cargo-pgx cargo pgx test pg${{ matrix.version }}
run: cd pgx-examples/custom_types cargo pgx test pg${{ matrix.version }}

- name: errors example
run: cd pgx-examples/errors && CARGO_TARGET_DIR=~/.cargo/cargo-pgx cargo pgx test pg${{ matrix.version }}
run: cd pgx-examples/errors cargo pgx test pg${{ matrix.version }}

- name: operators example
run: cd pgx-examples/operators && CARGO_TARGET_DIR=~/.cargo/cargo-pgx cargo pgx test pg${{ matrix.version }}
run: cd pgx-examples/operators cargo pgx test pg${{ matrix.version }}

- name: schemas example
run: cd pgx-examples/schemas && CARGO_TARGET_DIR=~/.cargo/cargo-pgx cargo pgx test pg${{ matrix.version }}
run: cd pgx-examples/schemas cargo pgx test pg${{ matrix.version }}

- name: shmem example
run: cd pgx-examples/shmem && CARGO_TARGET_DIR=~/.cargo/cargo-pgx cargo pgx test pg${{ matrix.version }}
run: cd pgx-examples/shmem cargo pgx test pg${{ matrix.version }}

- name: spi example
run: cd pgx-examples/spi && CARGO_TARGET_DIR=~/.cargo/cargo-pgx cargo pgx test pg${{ matrix.version }}
run: cd pgx-examples/spi cargo pgx test pg${{ matrix.version }}

- name: srf example
run: cd pgx-examples/srf && CARGO_TARGET_DIR=~/.cargo/cargo-pgx cargo pgx test pg${{ matrix.version }}
run: cd pgx-examples/srf cargo pgx test pg${{ matrix.version }}

- name: strings example
run: cd pgx-examples/strings && CARGO_TARGET_DIR=~/.cargo/cargo-pgx cargo pgx test pg${{ matrix.version }}
run: cd pgx-examples/strings cargo pgx test pg${{ matrix.version }}
13 changes: 1 addition & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,6 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: cache cargo artifacts
id: cargo-artifacts-cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/cargo-pgx
target
key: test-${{ matrix.os }}-${{ matrix.version }}-cargo-${{ hashFiles('~/work/pgx/pgx/**/Cargo.toml') }}

- name: cache cargo pgx init
id: cargo-pgx-init-cache
uses: actions/cache@v2
Expand All @@ -61,4 +50,4 @@ jobs:

# test our code
- name: cargo test
run: RUST_BACKTRACE=1 CARGO_TARGET_DIR=~/.cargo/cargo-pgx cargo test --all --features "pg${{ matrix.version }} pg_test" --no-default-features
run: RUST_BACKTRACE=1 cargo test --all --features "pg${{ matrix.version }} pg_test" --no-default-features

0 comments on commit 319e3f0

Please sign in to comment.