-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mark Sagi-Kazar <[email protected]>
- Loading branch information
1 parent
7d0c4c2
commit 5d86c6b
Showing
11 changed files
with
268 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
if ! has nix_direnv_version || ! nix_direnv_version 2.1.0; then | ||
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.1.0/direnvrc" "sha256-FAT2R9yYvVg516v3LiogjIc8YfsbWbMM/itqWsm5xTA=" | ||
fi | ||
use flake |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Dagger | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go: ['1.14', '1.15', '1.16', '1.17', '1.18'] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Dagger | ||
uses: dagger/dagger-for-github@v3 | ||
with: | ||
cmds: | | ||
project update | ||
do check test go ${{ matrix.go }} | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Dagger | ||
uses: dagger/dagger-for-github@v3 | ||
with: | ||
cmds: | | ||
project update | ||
do check lint |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/.direnv/ | ||
/tmp/ | ||
/vendor/ | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: '3' | ||
|
||
tasks: | ||
check: | ||
cmds: | ||
- dagger do check | ||
|
||
lint: | ||
cmds: | ||
- dagger do check lint | ||
|
||
fmt: | ||
cmds: | ||
- golangci-lint run --fix |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/gen/ | ||
/pkg/ | ||
/tmp/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github.com/sagikazarmark/dagger main |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github.com/sagikazarmark/dagger h1:tiyrgWTRtUgipmeZEaoN3y/ejlHHYI7pVSVTxmm/NWQ= |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module: "emperror.dev/errors" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package main | ||
|
||
import ( | ||
"dagger.io/dagger" | ||
|
||
"universe.dagger.io/go" | ||
|
||
"github.com/sagikazarmark/dagger/go/golangci" | ||
) | ||
|
||
dagger.#Plan & { | ||
client: filesystem: ".": read: exclude: [ | ||
".github", | ||
"bin", | ||
"build", | ||
"tmp", | ||
] | ||
// client: filesystem: "./build": write: contents: actions.build.debug.output | ||
client: network: "unix:///var/run/docker.sock": connect: dagger.#Socket | ||
|
||
actions: { | ||
_source: client.filesystem["."].read.contents | ||
|
||
check: { | ||
test: { | ||
"go": { | ||
"1.14": _ | ||
"1.15": _ | ||
"1.16": _ | ||
"1.17": _ | ||
"1.18": _ | ||
|
||
[v=string]: go.#Test & { | ||
source: _source | ||
name: "go_test_\(v)" | ||
package: "./..." | ||
|
||
_image: go.#Image & { | ||
version: v | ||
} | ||
|
||
input: _image.output | ||
command: flags: "-race": true | ||
} | ||
} | ||
} | ||
|
||
lint: { | ||
"golangci": golangci.#Lint & { | ||
source: _source | ||
version: "1.46" | ||
} | ||
} | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ | ||
description = "Drop-in replacement for the standard library errors package"; | ||
|
||
inputs = { | ||
nixpkgs.url = "nixpkgs/nixos-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
goflake.url = "github:sagikazarmark/go-flake"; | ||
goflake.inputs.nixpkgs.follows = "nixpkgs"; | ||
gobin.url = "github:sagikazarmark/go-bin-flake"; | ||
gobin.inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils, goflake, gobin, ... }: | ||
flake-utils.lib.eachDefaultSystem ( | ||
system: | ||
let | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
|
||
overlays = [ | ||
goflake.overlay | ||
|
||
( | ||
final: prev: { | ||
golangci-lint = gobin.packages.${system}.golangci-lint-bin; | ||
dagger = prev.buildGo118Module rec { | ||
pname = "dagger"; | ||
version = "0.2.12"; | ||
|
||
src = prev.fetchFromGitHub { | ||
owner = "dagger"; | ||
repo = "dagger"; | ||
rev = "v${version}"; | ||
sha256 = "sha256-t58+dfsf6A38RG4uT8SJPi07gkC9dGZo0WpVwN9N31k="; | ||
}; | ||
|
||
vendorSha256 = "sha256-7YKuOApIw4SG39BLb4kh7ZuZjhCBduzKo3iS8v8KZZU="; | ||
|
||
proxyModule = true; | ||
|
||
subPackages = [ | ||
"cmd/dagger" | ||
]; | ||
|
||
ldflags = [ "-s" "-w" "-X go.dagger.io/dagger/version.Revision=${version}" ]; | ||
}; | ||
} | ||
) | ||
]; | ||
}; | ||
|
||
buildDeps = with pkgs; [ git go_1_17 gnumake ]; | ||
devDeps = with pkgs; buildDeps ++ [ | ||
golangci-lint | ||
gotestsum | ||
dagger | ||
go-task | ||
]; | ||
in | ||
{ devShell = pkgs.mkShell { buildInputs = devDeps; }; } | ||
); | ||
} |