From f7cdcb1563057d6051356fe013afa3d9ddb2dafa Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Fri, 31 Jan 2025 23:09:40 +0100 Subject: [PATCH] chore: add CI and issue templates --- .github/ISSUE_TEMPLATE/BUG-REPORT.yml | 60 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml | 33 ++++++++++++ .github/workflows/ci.yaml | 47 +++++++++++++++++ justfile | 3 ++ 4 files changed, 143 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/BUG-REPORT.yml create mode 100644 .github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml create mode 100644 .github/workflows/ci.yaml diff --git a/.github/ISSUE_TEMPLATE/BUG-REPORT.yml b/.github/ISSUE_TEMPLATE/BUG-REPORT.yml new file mode 100644 index 0000000..17f328e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/BUG-REPORT.yml @@ -0,0 +1,60 @@ +name: Bug Report +description: File a bug report +title: "[Bug]: " +labels: ["bug/unconfirmed"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + - type: textarea + id: expected-behaviour + attributes: + label: Expected behaviour + description: How do you expect Georm to behave? + value: "Something should happen" + validations: + required: true + - type: textarea + id: what-happened + attributes: + label: Actual behaviour + description: How does the actual behaviour differ from the expected behaviour? + value: "Something else happened" + validations: + required: true + - type: dropdown + id: package-version + attributes: + label: Georm version + description: What version of Georm are you using? + options: + - main + - develop + - something else (please specify) + - type: dropdown + id: source + attributes: + label: Library source + description: From which source did you get the backend? + options: + - Crates.io + - Git version + - something else (please specify) + - type: textarea + id: rust-version + attributes: + label: Rust version + description: Which version of Rust did you use to build Georm? + value: "Rust 1.y.z" + - type: textarea + id: logs + attributes: + label: Relevant code or log output + description: Please copy and pase any relevant code or log output. This will be automatically formatted into code, so no need for backticks + render: text + - type: textarea + id: other-info + attributes: + label: Other relevant information + description: Please provide any other information which could be relevant to the issue (PostgreSQL version? Upstream bug?) diff --git a/.github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml b/.github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml new file mode 100644 index 0000000..3747613 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml @@ -0,0 +1,33 @@ +name: Feature Request +description: Request a new feature +title: "[Feature Request]: " +labels: ["enhancement"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to request a new feature! + - type: textarea + id: feature-description + attributes: + label: New feature + description: Description of the new feature + value: "New automatic method should do thing" + validations: + required: true + - type: textarea + id: feature-reason + attributes: + label: Why this new feature + description: Describe why this new feature should be added to Georm + value: "I use that workaround very often, this new method will simplify it" + validations: + required: true + - type: textarea + id: ideas-implementation + attributes: + label: Implementation ideas and additional thoughts + description: Do you have an idea on how to implement it? + value: "It could be implemented doing foo, bar, and baz" + validations: + required: false diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..0febf2e --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,47 @@ +name: CI +on: + pull_request: + push: +env: + DATABASE_URL: postgresql://georm:georm@postgres:5432/georm + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'ref/heads/master' }} + +jobs: + tests: + runs-on: ubuntu-latest + container: + image: catthehacker/ubuntu:js-latest + options: --security-opt seccomp=unconfined + permissions: + pull-requests: write + services: + postgres: + image: postgres:16-alpine + env: + POSTGRES_PASSWORD: georm + POSTGRES_USER: georm + POSTGRES_DB: georm + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 10s + --health-retries 5 + steps: + - uses: actions/checkout@v4 + - name: Install Nix + uses: cachix/install-nix-action@v27 + with: + nix_path: nixpkgs=channel:nixos-unstable + - name: Migrate database + run: nix develop --command -- just migrate + - name: Formatting check + run: nix develop --command -- just format-check + - name: Lint + run: nix develop --command -- just lint + - name: Audit + run: nix develop --command -- just audit + - name: Tests + run: nix develop --command -- just test diff --git a/justfile b/justfile index 30633cb..51b4ed5 100644 --- a/justfile +++ b/justfile @@ -14,6 +14,9 @@ lint: audit: cargo deny check all +migrate: + cargo sqlx migrate run + build: cargo build