Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.go text eol=lf
73 changes: 0 additions & 73 deletions .github/workflows/build.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/check-code-quality.yml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/quality-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: 💎 Quality Checks

on:
push:
workflow_dispatch:
workflow_call:

permissions:
contents: read

jobs:
golangci-lint:
strategy:
fail-fast: false
matrix:
go: [stable]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: ${{ matrix.go }}

- name: Run golangci-lint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9
with:
version: v2.11

tests:
strategy:
fail-fast: false
matrix:
go: [stable]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: ${{ matrix.go }}

- name: Run unit tests
shell: bash
run: go test ./...
25 changes: 12 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@ env:
CARGO_TERM_COLOR: always

jobs:
check:
name: 🦀 Check code quality
uses: Stausssi/sink/.github/workflows/check-code-quality.yml@main
quality-checks:
uses: ./.github/workflows/quality-checks.yml
secrets: inherit

build:
name: 🚧 Build sink binaries
needs: check
uses: Stausssi/sink/.github/workflows/build.yml@main
secrets: inherit
# build:
# name: 🚧 Build sink binaries
# needs: quality-checks
# uses: Stausssi/sink/.github/workflows/build.yml@main
# secrets: inherit

release:
runs-on: ubuntu-latest
needs: build
steps:
- run: echo "to be implemented."
# release:
# runs-on: ubuntu-latest
# needs: quality-checks
# steps:
# - run: echo "to be implemented."
39 changes: 31 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
# Generated by Cargo
# will have compiled files and executables
debug/
target/
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# These are backup files generated by rustfmt
**/*.rs.bk
# Test binary, built with `go test -c`
*.test

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
# Code coverage profiles and other test artifacts
*.out
coverage.*
*.coverprofile
profile.cov

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work
go.work.sum

# env file
.env

# Ignore selected local files
*.gitignored

# begin sink-managed section #
git_pour_test
release_pour_test
# end sink-managed section #
7 changes: 7 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: "2"
linters:
exclusions:
rules:
- path: _test\.go
linters:
- errcheck
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"golang.go",
"tamasfe.even-better-toml"
]
}
49 changes: 12 additions & 37 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,20 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'sink'",
"cargo": {
"args": [
"build",
"--bin=sink",
"--package=sink"
],
"filter": {
"name": "sink",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
"name": "Debug w/ headless dlv",
"type": "go",
"request": "attach",
"mode": "remote",
"port": 43000,
"host": "127.0.0.1",
"preLaunchTask": "Run headless dlv"
},
{
"type": "lldb",
"name": "Launch sink",
"type": "go",
"request": "launch",
"name": "Debug unit tests in executable 'sink'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=sink",
"--package=sink"
],
"filter": {
"name": "sink",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
"mode": "auto",
"program": "${workspaceFolder}/main.go",
}
]
}
}
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"files.associations": {
"*.sink": "ini",
"*.sink.ignore": "ini",
},
// I want to *actually* learn something here
"chat.disableAIFeatures": true,
"cSpell.words": [
"failable",
"Failable"
]
}
35 changes: 35 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Run headless dlv",
"type": "process",
"command": [
"/Users/simon/go/bin/dlv",
],
"args": [
"debug",
"--headless",
"--listen=:43000",
"--api-version=2",
"${workspaceFolder}/main.go",
"--",
// sink command goes here:
"pour"
],
"isBackground": true,
"problemMatcher": {
"owner": "go",
"fileLocation": "relative",
"pattern": {
"regexp": "^couldn't start listener:", // error if matched
},
"background": {
"activeOnStart": true,
"beginsPattern": "^API server listening at:",
"endsPattern": "^Got a connection, launched process" // success if matched
}
}
}
]
}
Loading
Loading