github.com/igoogolx/clash@v1.19.8/.github/workflows/test.yaml (about)

     1  name: Test
     2  
     3  on: [push, pull_request]
     4  
     5  jobs:
     6    test:
     7      name: Test
     8      runs-on: ubuntu-latest
     9      steps:
    10        - name: Setup Go
    11          uses: actions/setup-go@v4
    12          with:
    13            check-latest: true
    14            go-version: '1.21'
    15  
    16        - name: Check out code into the Go module directory
    17          uses: actions/checkout@v3
    18  
    19        - name: Cache go module
    20          uses: actions/cache@v3
    21          with:
    22            path: |
    23              ~/go/pkg/mod
    24              ~/.cache/go-build
    25            key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
    26            restore-keys: |
    27              ${{ runner.os }}-go-
    28  
    29        - name: Get dependencies, run test
    30          run: |
    31            go test ./...
    32  
    33    build-test:
    34      name: Build Test
    35      runs-on: ubuntu-latest
    36      steps:
    37        - name: Setup Go
    38          uses: actions/setup-go@v4
    39          with:
    40            check-latest: true
    41            go-version: '1.21'
    42  
    43        - name: Check out code into the Go module directory
    44          uses: actions/checkout@v3
    45  
    46        - name: Cache go module
    47          uses: actions/cache@v3
    48          with:
    49            path: |
    50              ~/go/pkg/mod
    51              ~/.cache/go-build
    52            key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
    53            restore-keys: |
    54              ${{ runner.os }}-go-
    55  
    56        - name: Build
    57          env:
    58            NAME: clash
    59            BINDIR: bin
    60          run: make -j $(go run ./test/main.go) all