update duration to duration_ms, make an int column #265
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v4 | |
with: | |
go-version: 1.21 | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
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-20.04 | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21 | |
- name: Checkout Steampipe | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
repository: turbot/steampipe | |
path: steampipe | |
- 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: 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@v3 | |
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@v3 | |
with: | |
path: ${{ steps.go-cache-paths.outputs.go-mod }} | |
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} | |
- 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: 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 | |