Skip to content

Commit

Permalink
wip: github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
pranshi06 committed Sep 19, 2024
1 parent ae72f21 commit 9fd7465
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 385 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
on: [push]

name: Postgres NDC component benchmarks
name: BigQuery NDC component benchmarks

permissions:
contents: write
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cargo-build.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
on: [push]

name: Postgres NDC build
name: BigQuery NDC build

jobs:
build:
name: Build Postgres NDC
name: Build BigQuery NDC
runs-on: ubuntu-latest
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
Expand Down
154 changes: 7 additions & 147 deletions .github/workflows/cargo-test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
on: [push]

name: Postgres NDC tests
name: BigQuery NDC tests

jobs:
test-query-engine:
Expand Down Expand Up @@ -36,8 +36,8 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.BROKEN_BUILD_SLACK_WEBHOOK_URL }}

test-postgres-ndc:
name: Test ndc-postgres
test-bigquery-ndc:
name: Test ndc-bigquery
runs-on: ubuntu-latest
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
Expand Down Expand Up @@ -66,9 +66,11 @@ jobs:
- name: run tests
run: |
cargo test --release -p ndc-postgres
cargo test --release -p ndc-bigquery
env:
POSTGRESQL_CONNECTION_STRING: postgresql://postgres:password@localhost:64002
HASURA_BIGQUERY_SERVICE_KEY: "{\"type\": \"service_account\",\"project_id\": \"hasura-development\",\"private_key_id\": \"222dd3f9e98b6743bb8d74d7a126fe89e6ac221d\",\"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDZuxyxWk6bOxHr\\nht+MPZ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KBgEzCzReF1ixMpt9p+PI6StrQdM01laBI2ZkjktWxUn1/Qebgs3FF\\nkiTBdMjxpABl6bUp/mgK2x8jjBuesJP0MRhhgoagJSUWV/GXKSYr7YgPmL9nGSex\\niFeEj+yp/F2SNKRaJImU3GZ5fB7wN2p8W/7vcNC3+IZnoWLlLdqsAroBAoGAdzZh\\nVoki9gfFq9uym1Kd9JUbipftHIBxcpeqt16un7GtIRiMaEP/2cpSGj4jf92/17wl\\nMA0JKekkUEaPeqzb43nLvJFLjrI0iyciDwx0eyX5w1A03CFP//0OicLWOgxr1AfU\\nMkpQ5uwRy4XqbsL/jGp5Fq/mlxPO8HrbfDSfcr0CgYEAxN/RMCYODz+p9xZ6tbiS\\nfHFrCgvPpYR9hEWhb/DyT4Q/OSzk0TItuSXGc3uicYeIycHIndyWej/a1HGg0IRK\\nqjGbqGvRJIrzhLvLog1oOGADFSE2IJrxV2m9lQG8IUow4QUFcoZaCXZAQEvWeo+D\\nq+4Pe2w4aMZeyqpt/mOSGzQ=\\n-----END PRIVATE KEY-----\\n\",\"client_email\": \"skm-bq-test@hasura-development.iam.gserviceaccount.com\",\"client_id\": \"116460406056940511807\",\"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\"token_uri\": \"https://oauth2.googleapis.com/token\",\"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/skm-bq-test%40hasura-development.iam.gserviceaccount.com\",\"universe_domain\": \"googleapis.com\"}"
HASURA_BIGQUERY_PROJECT_ID: "hasura-development"
HASURA_BIGQUERY_DATASET_ID: "chinook_sample"
RUST_LOG: INFO

# scream into Slack if something goes wrong
Expand All @@ -82,145 +84,3 @@ jobs:
message_format: "🐴 *{workflow}* {status_message} for <{repo_url}|{repo}>"
env:
SLACK_WEBHOOK_URL: ${{ secrets.BROKEN_BUILD_SLACK_WEBHOOK_URL }}

test-cockroach-ndc:
name: Test ndc-cockroach
runs-on: ubuntu-latest
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
RUSTFLAGS: "-D warnings" # fail on warnings
steps:
- uses: actions/checkout@v4

- name: install protoc
uses: arduino/setup-protoc@v2
with:
version: "23.3"

- name: install tools
run: |
rustup show
- uses: Swatinem/rust-cache@v2

- name: start dependencies
uses: isbang/compose-action@v1.5.1
with:
compose-file: "./docker-compose.yaml"
down-flags: "--volumes"
services: |
cockroach
- name: run tests
run: |
cargo test --release -p ndc-cockroach
env:
POSTGRESQL_CONNECTION_STRING: postgresql://postgres:password@localhost:64003
RUST_LOG: INFO

# scream into Slack if something goes wrong
- name: report status
if: github.ref == 'refs/heads/main'
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: failure
notification_title: "😧 Error on <{repo_url}|{repo}>"
message_format: "🐴 *{workflow}* {status_message} for <{repo_url}|{repo}>"
env:
SLACK_WEBHOOK_URL: ${{ secrets.BROKEN_BUILD_SLACK_WEBHOOK_URL }}

test-citus-ndc:
name: Test ndc-citus
runs-on: ubuntu-latest
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
RUSTFLAGS: "-D warnings" # fail on warnings
steps:
- uses: actions/checkout@v4

- name: install protoc
uses: arduino/setup-protoc@v2
with:
version: "23.3"

- name: install tools
run: |
rustup show
- uses: Swatinem/rust-cache@v2

- name: start dependencies
uses: isbang/compose-action@v1.5.1
with:
compose-file: "./docker-compose.yaml"
down-flags: "--volumes"
services: |
citus
- name: run tests
run: |
cargo test --release -p ndc-citus
env:
POSTGRESQL_CONNECTION_STRING: postgresql://postgres:password@localhost:64004
RUST_LOG: INFO

# scream into Slack if something goes wrong
- name: report status
if: github.ref == 'refs/heads/main'
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: failure
notification_title: "😧 Error on <{repo_url}|{repo}>"
message_format: "🐴 *{workflow}* {status_message} for <{repo_url}|{repo}>"
env:
SLACK_WEBHOOK_URL: ${{ secrets.BROKEN_BUILD_SLACK_WEBHOOK_URL }}

test-postgres-ndc-with-aurora:
name: Test ndc-postgres on AWS aurora
runs-on: ubuntu-latest
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
RUSTFLAGS: "-D warnings" # fail on warnings
steps:
- uses: actions/checkout@v4

- name: install protoc
uses: arduino/setup-protoc@v2
with:
version: "23.3"

- name: setup deployment
env:
AURORA_CONNECTION_STRING: ${{ secrets.AURORA_CONNECTION_STRING }}
run: |
# take connection string from env, create deployment file with it
cat static/aurora/chinook-deployment-template.json \
| jq '.connection_uris[0]=(env | .AURORA_CONNECTION_STRING)' \
> static/aurora/chinook-deployment.json
- name: install tools
run: |
rustup show
- uses: Swatinem/rust-cache@v2

- name: run tests
run: |
cargo test --release -p other-db-tests --all-features
env:
RUST_LOG: INFO
AURORA_CONNECTION_STRING: ${{ secrets.AURORA_CONNECTION_STRING }}

# scream into Slack if something goes wrong
- name: report status
if: github.ref == 'refs/heads/main'
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: failure
notification_title: "😧 Error on <{repo_url}|{repo}>"
message_format: "🐴 *{workflow}* {status_message} for <{repo_url}|{repo}>"
env:
SLACK_WEBHOOK_URL: ${{ secrets.BROKEN_BUILD_SLACK_WEBHOOK_URL }}
52 changes: 0 additions & 52 deletions .github/workflows/check-format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,55 +34,3 @@ jobs:
message_format: "🐴 *{workflow}* {status_message} for <{repo_url}|{repo}>"
env:
SLACK_WEBHOOK_URL: ${{ secrets.BROKEN_BUILD_SLACK_WEBHOOK_URL }}

nixpkgs-fmt:
name: check formatting with nixpkgs-fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: DeterminateSystems/nix-installer-action@v4

- uses: DeterminateSystems/magic-nix-cache-action@v2

- name: check formatting
run: |
nix develop --command nixpkgs-fmt --check .
# scream into Slack if something goes wrong
- name: Report Status
if: github.ref == 'refs/heads/main'
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: failure
notification_title: "😧 Error on <{repo_url}|{repo}>"
message_format: "🐴 *{workflow}* {status_message} for <{repo_url}|{repo}>"
env:
SLACK_WEBHOOK_URL: ${{ secrets.BROKEN_BUILD_SLACK_WEBHOOK_URL }}

prettier:
name: check formatting with prettier
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: DeterminateSystems/nix-installer-action@v4

- uses: DeterminateSystems/magic-nix-cache-action@v2

- name: check formatting
run: |
nix develop --command prettier --check .
# scream into Slack if something goes wrong
- name: Report Status
if: github.ref == 'refs/heads/main'
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: failure
notification_title: "😧 Error on <{repo_url}|{repo}>"
message_format: "🐴 *{workflow}* {status_message} for <{repo_url}|{repo}>"
env:
SLACK_WEBHOOK_URL: ${{ secrets.BROKEN_BUILD_SLACK_WEBHOOK_URL }}
30 changes: 0 additions & 30 deletions .github/workflows/configuration-docker-build.yaml

This file was deleted.

54 changes: 23 additions & 31 deletions .github/workflows/nix-check.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Postgres NDC nix check
name: BigQuery NDC nix check

on:
push:
Expand All @@ -8,50 +8,42 @@ jobs:
name: nix flake check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v4

- uses: DeterminateSystems/nix-installer-action@v4
- name: Install Nix ❄
uses: cachix/install-nix-action@V27
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- uses: DeterminateSystems/magic-nix-cache-action@v2
- name: Set up the Nix Cache πŸ”Œ
uses: cachix/cachix-action@v15
with:
name: hasura-v3-dev
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

- name: nix flake check
run: |
nix flake check --print-build-logs
# scream into Slack if something goes wrong
- name: Report Status
if: github.ref == 'refs/heads/main'
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: failure
notification_title: "😧 Error on <{repo_url}|{repo}>"
message_format: "🐴 *{workflow}* {status_message} for <{repo_url}|{repo}>"
env:
SLACK_WEBHOOK_URL: ${{ secrets.BROKEN_BUILD_SLACK_WEBHOOK_URL }}

nix-develop:
name: nix develop
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v4

- uses: DeterminateSystems/nix-installer-action@v4
- name: Install Nix ❄
uses: cachix/install-nix-action@V27
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- uses: DeterminateSystems/magic-nix-cache-action@v2
- name: Set up the Nix Cache πŸ”Œ
uses: cachix/cachix-action@v15
with:
name: hasura-v3-dev
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

- name: nix develop --command true
run: |
nix develop --print-build-logs --command true
# scream into Slack if something goes wrong
- name: Report Status
if: github.ref == 'refs/heads/main'
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: failure
notification_title: "😧 Error on <{repo_url}|{repo}>"
message_format: "🐴 *{workflow}* {status_message} for <{repo_url}|{repo}>"
env:
SLACK_WEBHOOK_URL: ${{ secrets.BROKEN_BUILD_SLACK_WEBHOOK_URL }}
Loading

0 comments on commit 9fd7465

Please sign in to comment.