Skip to content

Commit

Permalink
Merge pull request #17 from sagikazarmark/updates
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
sagikazarmark authored Oct 7, 2024
2 parents c4dcd3a + c0fcc49 commit 0d884a2
Show file tree
Hide file tree
Showing 14 changed files with 766 additions and 95 deletions.
6 changes: 3 additions & 3 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
if ! has nix_direnv_version || ! nix_direnv_version 3.0.6; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.6/direnvrc" "sha256-RYcUJaRMf8oF5LznDrlCXbkOQrywm0HDv1VjYGaJGdM="
fi
use flake
use flake . --impure
26 changes: 14 additions & 12 deletions .github/workflows/artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ name: Artifacts
on:
push:
branches: [main]
tags: ['v[0-9]+.[0-9]+.[0-9]+']
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
pull_request:

defaults:
run:
shell: nix develop .#ci -c bash {0}
permissions:
contents: read

jobs:
binaries:
Expand All @@ -21,32 +20,35 @@ jobs:
id-token: write

steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
fetch-depth: 0

- name: Set up Nix
uses: cachix/install-nix-action@v30
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # v27
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Set up magic Nix cache
uses: DeterminateSystems/magic-nix-cache-action@87b14cf437d03d37989d87f0fa5ce4f5dc1a330b # v8

- name: Prepare Nix shell
run: echo
run: nix develop --impure .#ci

- name: Check configuration
run: goreleaser check
run: nix develop --impure .#ci -c goreleaser check

- name: Check required dependencies
run: goreleaser healthcheck
run: nix develop --impure .#ci -c goreleaser healthcheck

- name: Build
run: goreleaser release --snapshot --skip-sign
run: nix develop --impure .#ci -c goreleaser release --clean --snapshot --skip sign
if: github.event_name != 'push' || github.ref_type != 'tag'

- name: Build and publish
run: goreleaser release
run: nix develop --impure .#ci -c goreleaser release --clean
if: github.event_name == 'push' && github.ref_type == 'tag'
env:
GITHUB_TOKEN: ${{ github.token }}
35 changes: 20 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,38 @@ on:
branches: [main]
pull_request:

defaults:
run:
shell: nix develop .#ci -c bash {0}
permissions:
contents: read

jobs:
test:
name: Test
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0

- name: Set up Nix
uses: cachix/install-nix-action@v30
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # v27
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Set up magic Nix cache
uses: DeterminateSystems/magic-nix-cache-action@87b14cf437d03d37989d87f0fa5ce4f5dc1a330b # v8

- name: Prepare Nix shell
run: echo
run: nix develop --impure .#ci

- name: Build
run: make build
run: nix develop --impure .#ci -c make build

- name: Test
run: make test
run: nix develop --impure .#ci -c make test

- name: Test proto
run: make testproto
run: nix develop --impure .#ci -c make testproto

- name: Annotate tests
uses: guyarb/golang-test-annotations@v0.7.0
Expand All @@ -47,19 +49,22 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0

- name: Set up Nix
uses: cachix/install-nix-action@v30
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # v27
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Set up magic Nix cache
uses: DeterminateSystems/magic-nix-cache-action@87b14cf437d03d37989d87f0fa5ce4f5dc1a330b # v8

- name: Prepare Nix shell
run: echo
run: nix develop --impure .#ci

- name: Lint
run: make lint
run: nix develop --impure .#ci -c make lint
env:
LINT_ARGS: --out-format=github-actions
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.devenv/
/.direnv/
/bin/
/build/
Expand Down
4 changes: 3 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
version: 2

project_name: protoc-gen-go-kit

builds:
Expand Down Expand Up @@ -32,7 +34,7 @@ signs:
artifacts: archive

changelog:
skip: true
disable: true

checksum:
name_template: 'checksums.txt'
Loading

0 comments on commit 0d884a2

Please sign in to comment.