Skip to content

Commit

Permalink
introducing the Hasura MongoDB Connector
Browse files Browse the repository at this point in the history
  • Loading branch information
hallettj committed Mar 12, 2024
0 parents commit 4025ffd
Show file tree
Hide file tree
Showing 265 changed files with 113,519 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# this line sources your `.envrc.local` file
source_env_if_exists .envrc.local
67 changes: 67 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: nix:deploy
on:
push:
branches:
- main
tags:
- 'v*'

jobs:
binary:
name: deploy::binary
runs-on: ubuntu-latest
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v3

- name: Install Nix ❄
uses: DeterminateSystems/nix-installer-action@v4

- name: Link Cachix πŸ”Œ
uses: cachix/cachix-action@v12
with:
name: '${{ vars.CACHIX_CACHE_NAME }}'
authToken: '${{ secrets.CACHIX_CACHE_AUTH_TOKEN }}'

- name: Login to GitHub Container Registry πŸ“¦
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: build the crate using nix πŸ”¨
run: nix build --print-build-logs

- name: Create release πŸš€
uses: actions/upload-artifact@v3
with:
name: mongodb-connector
path: result/bin/mongodb-connector

docker:
name: deploy::docker
needs: binary
runs-on: ubuntu-latest
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v3

- name: Install Nix ❄
uses: DeterminateSystems/nix-installer-action@v4

- name: Link Cachix πŸ”Œ
uses: cachix/cachix-action@v12
with:
name: '${{ vars.CACHIX_CACHE_NAME }}'
authToken: '${{ secrets.CACHIX_CACHE_AUTH_TOKEN }}'

- name: Login to GitHub Container Registry πŸ“¦
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy πŸš€
run: nix run .#publish-docker-image ${{ github.ref }}
56 changes: 56 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Tests

on:
push:
branches:
- main
- 'v*'
pull_request:

# The build job caches build artifacts which avoids duplicating work between the
# unit and API tests.
jobs:
build:
name: Build the connector
runs-on: ubuntu-latest
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v3

- name: Install Nix ❄
uses: DeterminateSystems/nix-installer-action@v4

- name: Link Cachix πŸ”Œ
uses: cachix/cachix-action@v12
with:
name: '${{ vars.CACHIX_CACHE_NAME }}'
authToken: '${{ secrets.CACHIX_CACHE_AUTH_TOKEN }}'

- name: build the crate πŸ”¨
run: nix build --print-build-logs

unit_tests:
name: Unit Tests
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v3

- name: Install Nix ❄
uses: DeterminateSystems/nix-installer-action@v4

- name: Link Cachix πŸ”Œ
uses: cachix/cachix-action@v12
with:
name: '${{ vars.CACHIX_CACHE_NAME }}'
authToken: '${{ secrets.CACHIX_CACHE_AUTH_TOKEN }}'

- name: run unit tests πŸ”¨
run: nix build .#checks.x86_64-linux.test --print-build-logs

- name: run linter checks with clippy πŸ”¨
run: nix build .#checks.x86_64-linux.lint --print-build-logs

- name: audit for reported security problems πŸ”¨
run: nix build .#checks.x86_64-linux.audit --print-build-logs
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
/.direnv/
/.envrc.local
/result

# Ignore arion temporary files
.tmp*
Loading

0 comments on commit 4025ffd

Please sign in to comment.