Skip to content

Commit 973aa81

Browse files
Fixes macos-11 tests (#1197)
For some reason, brew suddenly stopped working on macos-11 GHA instances. The only place we were using brew was to install sccache, so these changes remove the use of brew to install sccache and instead install sccache manually. These changes also run all tests on macos-11 instead of selective tests.
1 parent 8b7e20b commit 973aa81

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

.github/workflows/tests.yml

+26-24
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,9 @@ jobs:
401401
if: "!contains(github.event.head_commit.message, 'nogha')"
402402
env:
403403
RUSTC_WRAPPER: sccache
404+
SCCACHE_CACHE_SIZE: 20G
405+
SCCACHE_DIR: /Users/runner/Library/Caches/Mozilla.sccache
406+
SCCACHE_IDLE_TIMEOUT: 0
404407

405408
strategy:
406409
matrix:
@@ -414,9 +417,11 @@ jobs:
414417
echo ""
415418
416419
echo "----- Install sccache -----"
417-
brew update
418-
brew install sccache
419-
mkdir -p /Users/runner/Library/Caches/Mozilla.sccache
420+
curl -L https://github.com/mozilla/sccache/releases/download/v0.5.4/sccache-v0.5.4-x86_64-apple-darwin.tar.gz | tar xz
421+
mv -f sccache-v0.5.4-x86_64-apple-darwin/sccache /usr/local/bin
422+
chmod +x /usr/local/bin/sccache
423+
mkdir -p $SCCACHE_DIR
424+
sccache --version
420425
421426
# https://stackoverflow.com/questions/57968497/how-do-i-set-an-env-var-with-a-bash-expression-in-github-actions/57969570#57969570
422427
echo "----- Getting pre-installed Postgres major version -----"
@@ -426,7 +431,7 @@ jobs:
426431
427432
echo "----- Set up Postgres permissions -----"
428433
sudo chmod a+rwx `$(which pg_config) --pkglibdir` `$(which pg_config) --sharedir`/extension
429-
ls -lath `$(which pg_config) --pkglibdir` `$(which pg_config) --sharedir`/extension
434+
# ls -lath `$(which pg_config) --pkglibdir` `$(which pg_config) --sharedir`/extension
430435
echo ""
431436
432437
echo "----- Output Cargo version -----"
@@ -437,46 +442,43 @@ jobs:
437442
env
438443
echo ""
439444
445+
440446
- name: Cache sccache directory
441447
uses: actions/cache@v3
442448
continue-on-error: false
443449
with:
444450
path: /Users/runner/Library/Caches/Mozilla.sccache
445-
key: pgrx-sccache-macos-11-${{ hashFiles('**/Cargo.lock', '.github/workflows/tests.yml') }}
451+
key: pgrx-sccache-macos-11-${{ hashFiles('**/Cargo.lock', '.github/workflows/tests.yml', '.cargo/config.toml') }}
452+
453+
- name: Cache cargo directory
454+
uses: actions/cache@v3
455+
with:
456+
path: |
457+
~/.cargo
458+
key: pgrx-cargo-macos-11-tests-${{ hashFiles('**/Cargo.lock', '.github/workflows/tests.yml', '.cargo/config.toml') }}
446459

447460
- name: Start sccache server
448461
run: sccache --start-server
449462

450463
- name: Print sccache stats
451464
run: sccache --show-stats
452465

453-
- name: Cache cargo directory
454-
uses: actions/cache@v3
455-
with:
456-
path: |
457-
~/.cargo/registry
458-
~/.cargo/git
459-
key: pgrx-macos-11-tests-${{ hashFiles('**/Cargo.lock', '.github/workflows/tests.yml') }}
460-
461466
- name: Install cargo-pgrx
462467
run: cargo install --path cargo-pgrx/ --debug --force
463468

469+
- name: Print sccache stats
470+
run: sccache --show-stats
471+
464472
- name: Run 'cargo pgrx init'
465473
run: |
466474
set -x
467475
cargo pgrx init --pg$PG_VER $(which pg_config)
468476
469-
- name: Run base-level tests
470-
run: |
471-
set -x
472-
cargo test \
473-
--features "pg$PG_VER" --no-default-features \
474-
--package cargo-pgrx \
475-
--package pgrx \
476-
--package pgrx-macros \
477-
--package pgrx-pg-sys \
478-
--package pgrx-tests \
479-
--package pgrx-sql-entity-graph
477+
- name: Run tests
478+
run: cargo test --all --features "pg$PG_VER pg_test cshim" --no-default-features
479+
480+
- name: Print sccache stats
481+
run: sccache --show-stats
480482

481483
- name: Stop sccache server
482484
run: sccache --stop-server || true

0 commit comments

Comments
 (0)