aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/go.yml
blob: e4f4a94cce98d61406475cbb6c68a25a675cf1e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Go

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:

  build:
    runs-on: ubuntu-24.04
    steps:
    - uses: actions/checkout@v4
    
    - name: Set up Homebrew
      uses: Homebrew/actions/setup-homebrew@master

    - name: Setup Homebrew cellar cache
      uses: actions/cache@v4
      with:
        path: |
          ~/.linuxbrew/Cellar
        key: ${{ runner.os }}-homebrew-cellar-${{ hashFiles('Brewfile.lock.json') }}
        restore-keys: |
          ${{ runner.os }}-homebrew-cellar-

    - name: Install Brew dependencies
      run: |
        brew bundle

    - name: Setup Golang caches
      uses: actions/cache@v4
      with:
        path: |
          ~/.cache/go-build
          ~/go/pkg/mod
        key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
        restore-keys: |
          ${{ runner.os }}-golang-

    - name: cache deno.land dependencies
      uses: actions/cache@v2
      with:
        key: ${{ runner.os }}-deno-${{ hashFiles('**/*') }}
        restore-keys: ${{ runner.os }}-deno-
        path: |
          /home/runner/.cache/deno

    - name: Build
      run: go build -v ./...

    - name: Test
      run: go test -v ./...