Skip to content

Update steampipe reference - Update CreateConnectionPlugins to do not abort when unrelated connections are not yet loaded. Closes #474 #307

Update steampipe reference - Update CreateConnectionPlugins to do not abort when unrelated connections are not yet loaded. Closes #474

Update steampipe reference - Update CreateConnectionPlugins to do not abort when unrelated connections are not yet loaded. Closes #474 #307

Workflow file for this run

name: FDW Acceptance Tests
on:
pull_request:
jobs:
golangci_lint:
name: golangci-lint
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21
- name: golangci-lint
uses: golangci/golangci-lint-action@v5
continue-on-error: true # we dont want to enforce just yet
with:
version: v1.52.2
args: --timeout=15m --config=.golangci.yml
build_and_test:
name: Build and run tests
needs: golangci_lint
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21
- name: Checkout Steampipe
uses: actions/checkout@v4
with:
submodules: true
repository: turbot/steampipe
path: steampipe
- name: Fetching Go Cache Paths
id: go-cache-paths
run: |
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
- name: Go Build Cache
id: build-cache
uses: actions/cache@v4
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
- name: Go Mod Cache
id: mod-cache
uses: actions/cache@v4
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
- name: Build Steampipe
run: |
echo "PATH=$PATH:$HOME/build:/home/runner" >> $GITHUB_ENV
ls /home/runner/work/steampipe-postgres-fdw/steampipe-postgres-fdw
cd /home/runner/work/steampipe-postgres-fdw/steampipe-postgres-fdw/steampipe
go get
go build -o /home/runner/steampipe
- name: Run steampipe
run: |
steampipe query "select 1 as col"
- name: Checkout FDW
uses: actions/checkout@v4
with:
repository: turbot/steampipe-postgres-fdw
path: steampipe-postgres-fdw
- name: Setup apt-get
run: |-
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo env ACCEPT_EULA=Y apt-get update
sudo env ACCEPT_EULA=Y apt-get upgrade
- name: Install PostgreSQL14 Dev
run: |-
sudo apt-get -y install postgresql-server-dev-14
- name: Find stuff and set env
run: |-
which pg_config
pg_config --version
export PATH=$(pg_config --bindir):$PATH
export PGXS=$(pg_config --pgxs)
export SERVER_LIB=$(pg_config --includedir)/14/server
export INTERNAL_LIB=$(pg_config --includedir)/internal
export CFLAGS="$(pg_config --cflags) -I${SERVER_LIB} -I${INTERNAL_LIB} -g"
export PG_CFLAGS="$(pg_config --cflags) -I${SERVER_LIB} -I${INTERNAL_LIB} -g"
export LDFLAGS=$(pg_config --ldflags)
export PG_LDFLAGS=$(pg_config --ldflags)
ls -la $SERVER_LIB
ls -la $INTERNAL_LIB
- name: Build FDW
run: |
cd ~/work/steampipe-postgres-fdw/steampipe-postgres-fdw/steampipe-postgres-fdw/
make install
- name: GZip
run: |
cd ~/work/steampipe-postgres-fdw/steampipe-postgres-fdw/steampipe-postgres-fdw
tar -czvf ../build.tar.gz ./build-$(uname)
- name: Upload FDW Build
uses: actions/upload-artifact@v4
with:
name: fdw-build
path: build.tar.gz
- name: Setup BATS
uses: mig4/setup-bats@v1
with:
bats-version: 1.2.1
- name: Install Chaos plugin from registry
run: steampipe plugin install chaos
- name: Go install jd
run: |
go install github.com/josephburnett/jd@latest
- name: Run tests
timeout-minutes: 6
run: |
cd /home/runner/work/steampipe-postgres-fdw/steampipe-postgres-fdw/steampipe
chmod +x tests/acceptance/run.sh
./tests/acceptance/run.sh chaos_and_query.bats