Skip to content

Commit

Permalink
more flake stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
trs-ibf committed Aug 19, 2024
1 parent ddc7df3 commit 8b6de4c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 67 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/build.yml

This file was deleted.

59 changes: 18 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,30 @@ jobs:
name: Code style
runs-on: ubuntu-latest
steps:
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libmpv-dev
version: 1.0
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: '^1.19'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
- uses: cachix/install-nix-action@v25
with:
version: latest
skip-cache: true
skip-pkg-cache: true
skip-build-cache: true
nix_path: nixpkgs=channel:nixos-unstable
- uses: DeterminateSystems/magic-nix-cache-action@v2
- name: Lint
run: nix develop --command "golangci-lint run"

unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libmpv-dev
version: 1.0
- uses: actions/checkout@v3

- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v3
- uses: cachix/install-nix-action@v25
with:
go-version: '^1.19'
nix_path: nixpkgs=channel:nixos-unstable
- uses: DeterminateSystems/magic-nix-cache-action@v2
- name: Run units tests
run: go test -json ./... > test.json
run: nix develop --command "go test -json ./... > test.json"
- name: Annotate tests
if: always()
uses: guyarb/[email protected]
Expand All @@ -59,25 +49,12 @@ jobs:
name: Build Radioboat
runs-on: ubuntu-latest
needs: [unit-tests]
strategy:
matrix:
go_version: ['1.20.x', '1.21.x', '1.22.x']
steps:
- uses: awalsh128/cache-apt-pkgs-action@latest
- uses: actions/checkout@v4
with:
packages: libmpv-dev
version: 1.0
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go_version }}
- name: Build
run: go build -v .
- name: Upload binary
uses: actions/upload-artifact@v1
fetch-depth: 0
- uses: cachix/install-nix-action@v25
with:
name: binary_${{ matrix.go_version }}
path: ./radioboat
nix_path: nixpkgs=channel:nixos-unstable
- uses: DeterminateSystems/magic-nix-cache-action@v2
- name: nix build
10 changes: 2 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,14 @@
"x86_64-linux"
"aarch64-darwin"
"aarch64-linux"
"aarch64-applr-darwin"
"aarch64-apple-darwin"
] (system: function nixpkgs.legacyPackages.${system});
in {
packages = forAllSystems (pkgs: {
default = pkgs.callPackage ./default.nix {};
});
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
buildInputs = with pkgs; [
nurl
nix-update
nvfetcher
];
};
default = import ./shell.nix {inherit pkgs;};
});
};
}
6 changes: 3 additions & 3 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{pkgs ? import <nixpkgs> {}}:
pkgs.mkShell {
# nativeBuildInputs is usually what you want -- tools you need to run
buildInputs = [pkgs.mpv];

nativeBuildInputs = with pkgs; [
gnumake

Expand All @@ -9,8 +11,6 @@ pkgs.mkShell {
gopls
go-tools
delve

# lib
mpv
golangci-lint
];
}

0 comments on commit 8b6de4c

Please sign in to comment.