Skip to content

Commit

Permalink
add minimal ci
Browse files Browse the repository at this point in the history
  • Loading branch information
negrel committed Jan 8, 2024
1 parent 0e496d4 commit 3a8b97c
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 3 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: push
on:
push:
paths-ignore:
- ".gitignore"
- ".github/images"
- "README.md"
jobs:
push:
if: "! contains(github.ref, 'refs/tags/')"
runs-on: ubuntu-20.04
env:
GENENV_FILE: ./config/genenv.ci.sh
STRIPE_KEY: ${{ secrets.STRIPE_KEY }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: cachix/install-nix-action@v22
with:
extra_nix_config: "system-features = nixos-test benchmark big-parallel kvm"
- run: printenv
- name: Lint
run: nix develop --command make lint
- name: Unit tests
run: nix develop --command make test/unit
- name: Docker build
run: REMOVE_RESULT=0 nix develop --command make docker/build
- name: End to end tests
run: nix develop --command make test/e2e
- name: Store docker image as artifact
uses: actions/upload-artifact@v3
with:
name: docker-image
path: ./result

19 changes: 17 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,22 @@
start:
go run ./cmd/server

.PHONY: test
test:
.PHONY: lint
lint:
golangci-lint run --timeout 2m ./...

.PHONY: test/unit
test/unit:
go test -v -p 1 -count=1 ./...

.PHONY: test/e2e
test/e2e:
@true

.PHONY: build
build:
@true

.PHONY: docker/build
docker/build:
@true
6 changes: 5 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
{
devShells = {
default = pkgs.mkShell {
buildInputs = with pkgs; [ go gopls ];
buildInputs = with pkgs; [
go
gopls
golangci-lint
];
};
};
});
Expand Down

0 comments on commit 3a8b97c

Please sign in to comment.