diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..05a7cc8 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,48 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + tests: + name: Test + permissions: + contents: read + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-22.04] + go: ["1.21.10", "1.22.3"] + + steps: + - name: Setup Go + uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 + with: + go-version: ${{ matrix.go }} + + - name: Code checkout + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + + - name: go mod download + env: + CGO_ENABLED: 0 + run: | + go mod download + + - name: go test + env: + CGO_ENABLED: 0 + run: | + go test ./... + + - name: go test -race + env: + CGO_ENABLED: 1 + run: | + go test -race ./... diff --git a/.github/workflows/nix.yaml b/.github/workflows/nix.yaml new file mode 100644 index 0000000..79cf0a8 --- /dev/null +++ b/.github/workflows/nix.yaml @@ -0,0 +1,28 @@ +name: nix + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + flake-check: + name: flake check + runs-on: ubuntu-22.04 + permissions: + contents: read + steps: + - name: Code checkout + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@8cdf194da984e4f12b2f8c36d1fa107c1dd67f5c # v11 + + - name: Nix Cache + uses: DeterminateSystems/magic-nix-cache-action@87e8236f46702ab0ce5a058b605a173ec88d618e # v6 + + - name: nix flake check + run: nix flake check --all-systems