forked from wenzhixin/bootstrap-table
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (55 loc) · 2.27 KB
/
check-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
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
on: # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-using-a-list-of-events
push:
paths:
- "site/docs/api/*.md" # Because this script checks these documents, so runs this action if and only if they changed.
#branches:
# - master
pull_request:
paths:
- "site/docs/api/*.md"
name: check-api-md-file-is-ok
env: # Sharing with all jobs.
GOPROXY: https://proxy.golang.org
GO111MODULE: on
MY-GO-TOOL-DIR: tools/go
# PROJECT_PATH: "./tools/go" # https://github.com/marketplace/actions/golang-action#golang-action
jobs:
job-init:
name: Show Info
# env: # set env for an individual job.
strategy: # not sharing with different job
matrix:
os: [windows-latest] # [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Show Info # https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context
run: |
echo ${{ github.repository }}
job-test:
name: Test
if: success() # job run only if the success of the previous steps
needs: job-init # [job-install-require, job2,...]
strategy:
matrix:
go-version: [1.16.x]
os: [windows-latest] # [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2 # https://github.com/actions/checkout # ❗ Important ❗ so that the GitHub file to be able to present. If missing, then it can't find out the working-directory.
- name: Install Go
uses: actions/setup-go@37335c7bb261b353407cff977110895fa0b4f7d8 # v2, v2.1.3 # https://github.com/actions/setup-go
with: # a step cannot have both the `uses` and `run` keys
go-version: ${{ matrix.go-version }}
- name: Install Mage # v1.11.0 # https://github.com/magefile/mage
run: |
go version
go get github.com/magefile/mage@07afc7d24f4d6d6442305d49552f04fbda5ccb3e
mage -version
- name: Test
# mage -d "tools/go" -v check
# mage -v check
# working-directory: ${{env.MY-GO-TOOL-DIR}}
run: |
dir .
mage -d "tools/go" -v check