-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.63 KB
/
build-api.yml
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
55
56
57
58
59
60
61
name: Build Wpp-Api-App Archive
on:
workflow_dispatch:
release:
types: [released]
push:
pull_request:
concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest'] # "macOS-latest"
go: ['1.22.x', '1.21.x'] #'1.19.x',
runs-on: ${{ matrix.os }}
env:
GOPRIVATE: github.com/wordpress-plus
GH_PRIVATE_TOKEN: ${{ secrets.GH_PRIVATE_TOKEN }}
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, '[image]')"
steps:
- name: Export Global Var
run: |
echo "PROJECT_HOME=$PWD" >> $GITHUB_ENV
- name: Checkout Code
uses: actions/checkout@v4
- uses: WillAbides/setup-go-faster@v1.12.0
with:
go-version: ${{ matrix.go }}
- run: git config --global url.https://$GH_PRIVATE_TOKEN@github.com/.insteadOf https://github.com/
- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
${{ env.GOPATH }}/pkg/mod
key: go-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
go-${{ runner.os }}-
- name: Download Dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
working-directory: ./
- name: Test and Build
run: |
go build -v -race
working-directory: ./