1- name : CI lints and tests
1+ name : CI lints and tests on x86_64
22on :
33 push :
44 branches : [ "main" ]
1616 SCCACHE_DIR : /home/runner/.cache/sccache
1717
1818jobs :
19- build-and-test :
20- runs-on : ubuntu-latest
19+ build-and-test-x64 :
20+ runs-on : [x64, ubuntu-latest]
2121 strategy :
2222 matrix :
2323 postgres : [ 14, 15, 16, 17 ]
2424 env :
2525 PG_MAJOR : ${{ matrix.postgres }}
26+ PG_CONFIG : /usr/lib/postgresql/${{ matrix.postgres }}/bin/pg_config
2627
2728 steps :
2829 - uses : actions/checkout@v4
@@ -56,21 +57,14 @@ jobs:
5657 ~/.cargo/registry/index
5758 ~/.cargo/registry/cache
5859 ~/.cargo/git/db
59- key : pg_parquet-rust-cache-${{ runner.os }}-${{ hashFiles('Cargo.lock', '.github/workflows/ci.yml') }}
60+ key : pg_parquet-rust-cache-${{ runner.arch }}-${{ runner. os }}-${{ hashFiles('Cargo.lock', '.github/workflows/ci.yml') }}
6061
6162 - name : Cache sccache directory
6263 uses : actions/cache@v4
6364 continue-on-error : false
6465 with :
6566 path : ${{ env.SCCACHE_DIR }}
66- key : pg_parquet-sccache-cache-${{ runner.os }}-${{ hashFiles('Cargo.lock', '.github/workflows/ci.yml') }}
67-
68- - name : Export environment variables from .env file
69- uses : falti/dotenv-action@v1
70- with :
71- path : .devcontainer/.env
72- export-variables : true
73- keys-case : bypass
67+ key : pg_parquet-sccache-cache-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('Cargo.lock', '.github/workflows/ci.yml') }}
7468
7569 - name : Install PostgreSQL
7670 run : |
@@ -96,92 +90,27 @@ jobs:
9690 echo "deb [arch=`dpkg --print-architecture` signed-by=/etc/apt/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/azure-cli/ `lsb_release -cs` main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
9791 sudo apt-get update && sudo apt-get install -y azure-cli
9892
99- - name : Install and configure pgrx
93+ - name : Install pgrx
10094 run : |
10195 cargo install --locked [email protected] 102- cargo pgrx init --pg${{ env.PG_MAJOR }} /usr/lib/postgresql/${{ env.PG_MAJOR }}/bin/pg_config \
103- --base-testing-port $PGRX_TEST_PG_BASE_PORT
10496
10597 - name : Install cargo-llvm-cov for coverage report
10698 run :
cargo install --locked [email protected] 10799
108- - name : Format and lint
109- run : |
110- cargo fmt --all -- --check
111- cargo clippy --all-targets --features "pg${{ env.PG_MAJOR }}, pg_test" --no-default-features -- -D warnings
112-
113100 - name : Set up permissions for PostgreSQL
114101 run : |
115102 sudo chmod a+rwx $(/usr/lib/postgresql/${{ env.PG_MAJOR }}/bin/pg_config --pkglibdir) \
116103 $(/usr/lib/postgresql/${{ env.PG_MAJOR }}/bin/pg_config --sharedir)/extension \
117104 /var/run/postgresql/
118105
119- - name : Start Minio for s3 emulator tests
120- run : |
121- docker run -d \
122- --env-file .devcontainer/.env \
123- -p 9000:9000 \
124- --entrypoint "./entrypoint.sh" \
125- --volume ./.devcontainer/minio-entrypoint.sh:/entrypoint.sh \
126- minio/minio
127-
128- while ! curl $AWS_ENDPOINT_URL; do
129- echo "Waiting for $AWS_ENDPOINT_URL..."
130- sleep 1
131- done
132-
133- - name : Start Azurite for Azure Blob Storage emulator tests
134- run : |
135- docker run -d \
136- --env-file .devcontainer/.env \
137- -p 10000:10000 \
138- mcr.microsoft.com/azure-storage/azurite
139-
140- while ! curl $AZURE_STORAGE_ENDPOINT; do
141- echo "Waiting for $AZURE_STORAGE_ENDPOINT..."
142- sleep 1
143- done
144-
145- # create container
146- az storage container create -n $AZURE_TEST_CONTAINER_NAME --connection-string $AZURE_STORAGE_CONNECTION_STRING
147- az storage container create -n ${AZURE_TEST_CONTAINER_NAME}2 --connection-string $AZURE_STORAGE_CONNECTION_STRING
148-
149- - name : Start local web server for http(s) tests
106+ - name : Check format and lint
150107 run : |
151- docker run -d \
152- --env-file .devcontainer/.env \
153- -p 8080:80 \
154- rclone/rclone serve webdav /data --addr :80
155-
156- while ! curl $HTTP_ENDPOINT; do
157- echo "Waiting for $HTTP_ENDPOINT..."
158- sleep 1
159- done
160-
161- - name : Start fake-gcs-server for Google Cloud Storage emulator tests
162- run : |
163- docker run -d \
164- --env-file .devcontainer/.env \
165- -p 4443:4443 \
166- tustvold/fake-gcs-server -scheme http -public-host localhost:4443
167-
168- while ! curl $GOOGLE_SERVICE_ENDPOINT; do
169- echo "Waiting for $GOOGLE_SERVICE_ENDPOINT..."
170- sleep 1
171- done
172-
173- # create bucket
174- curl -v -X POST --data-binary "{\"name\":\"$GOOGLE_TEST_BUCKET\"}" -H "Content-Type: application/json" "$GOOGLE_SERVICE_ENDPOINT/storage/v1/b"
175- curl -v -X POST --data-binary "{\"name\":\"${GOOGLE_TEST_BUCKET}2\"}" -H "Content-Type: application/json" "$GOOGLE_SERVICE_ENDPOINT/storage/v1/b"
108+ make check-format
109+ make check-lint
176110
177111 - name : Run tests
178112 run : |
179- # Run tests with coverage tool
180- source <(cargo llvm-cov show-env --export-prefix)
181- cargo llvm-cov clean
182- cargo build --features "pg${{ env.PG_MAJOR }}, pg_test" --no-default-features
183- cargo pgrx test pg${{ env.PG_MAJOR }} --no-default-features
184- cargo llvm-cov report --lcov > lcov.info
113+ make check-with-coverage
185114
186115 - name : Upload coverage report to Codecov
187116 if : ${{ env.PG_MAJOR }} == 17
0 commit comments