1- name : Rust check
1+ name : Rust
22
33on :
44 push :
@@ -101,6 +101,67 @@ jobs:
101101 run : cargo clippy --no-default-features --features "pg$VERSION" --target $ARCH-unknown-linux-gnu
102102 - name : Build
103103 run : cargo build --no-default-features --features "pg$VERSION" --target $ARCH-unknown-linux-gnu
104+ - name : Post Set up Cache
105+ uses : actions/cache/save@v4
106+ if : ${{ !steps.cache.outputs.cache-hit }}
107+ with :
108+ path : |
109+ ~/.cargo/registry/index/
110+ ~/.cargo/registry/cache/
111+ ~/.cargo/git/db/
112+ key : ${{ github.job }}-${{ hashFiles('./Cargo.lock') }}-${{ matrix.version }}-${{ matrix.arch }}
113+ test :
114+ strategy :
115+ matrix :
116+ arch : ["x86_64", "aarch64"]
117+ runs-on : ubuntu-latest
118+ env :
119+ SEMVER : " 0.0.0"
120+ VERSION : " 16"
121+ ARCH : ${{ matrix.arch }}
122+ steps :
123+ - name : Checkout
124+ uses : actions/checkout@v4
125+ - name : Set up Environment
126+ run : |
127+ sudo apt-get remove -y '^postgres.*' '^libpq.*' '^clang.*' '^llvm.*' '^libclang.*' '^libllvm.*' '^mono-llvm.*'
128+ sudo apt-get purge -y '^postgres.*' '^libpq.*' '^clang.*' '^llvm.*' '^libclang.*' '^libllvm.*' '^mono-llvm.*'
129+ sudo apt-get update
130+ sudo apt-get install -y build-essential crossbuild-essential-arm64
131+ sudo apt-get install -y qemu-user-static
132+ touch ~/.cargo/config.toml
133+ echo 'target.aarch64-unknown-linux-gnu.linker = "aarch64-linux-gnu-gcc"' >> ~/.cargo/config.toml
134+ echo 'target.aarch64-unknown-linux-gnu.runner = ["qemu-aarch64-static", "-L", "/usr/aarch64-linux-gnu"]' >> ~/.cargo/config.toml
135+ - name : Set up Sccache
136+ uses :
mozilla-actions/[email protected] 137+ - name : Set up Cache
138+ uses : actions/cache/restore@v4
139+ id : cache
140+ with :
141+ path : |
142+ ~/.cargo/registry/index/
143+ ~/.cargo/registry/cache/
144+ ~/.cargo/git/db/
145+ key : ${{ github.job }}-${{ hashFiles('./Cargo.lock') }}-${{ matrix.arch }}
146+ - name : Set up Clang-16
147+ run : |
148+ sudo sh -c 'echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-16 main" >> /etc/apt/sources.list'
149+ wget --quiet -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
150+ sudo apt-get update
151+ sudo apt-get install -y clang-16
152+ - name : Set up Pgrx
153+ run : |
154+ # pg_config
155+ mkdir -p ~/.pg_config
156+ touch ~/.pg_config/pg_config
157+ chmod 777 ~/.pg_config/pg_config
158+ echo "#!/usr/bin/env bash" >> ~/.pg_config/pg_config
159+ echo "$(pwd)/tools/pg_config.sh \"\$@\" < $(pwd)/vendor/pg_config/pg${VERSION}_${ARCH}-unknown-linux-gnu.txt" >> ~/.pg_config/pg_config
160+ mkdir -p ~/.pgrx && echo "configs.pg$VERSION=\"$HOME/.pg_config/pg_config\"" > ~/.pgrx/config.toml
161+ # pgrx_binding
162+ mkdir -p ~/.pgrx_binding
163+ cp ./vendor/pgrx_binding/pg${VERSION}_$(uname --machine)-unknown-linux-gnu.rs ~/.pgrx_binding/pg${VERSION}_raw_bindings.rs
164+ echo PGRX_TARGET_INFO_PATH_PG$VERSION=$HOME/.pgrx_binding >> "$GITHUB_ENV"
104165 - name : Test
105166 run : cargo test --all --no-fail-fast --no-default-features --features "pg$VERSION" --target $ARCH-unknown-linux-gnu -- --nocapture
106167 - name : Test (x86_64)
@@ -118,4 +179,4 @@ jobs:
118179 ~/.cargo/registry/index/
119180 ~/.cargo/registry/cache/
120181 ~/.cargo/git/db/
121- key : ${{ github.job }}-${{ hashFiles('./Cargo.lock') }}-${{ matrix.version }}-${{ matrix. arch }}
182+ key : ${{ github.job }}-${{ hashFiles('./Cargo.lock') }}-${{ matrix.arch }}
0 commit comments