|
1 | | -name: Run tests |
| 1 | +# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/publish-go-tester-task.md |
| 2 | +name: Publish Tester Build |
2 | 3 |
|
| 4 | +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows |
3 | 5 | on:
|
4 | 6 | push:
|
5 | 7 | paths:
|
6 | | - - ".github/workflows/test.yml" |
7 | | - - "Taskfile.yml" |
| 8 | + - ".github/workflows/publish-go-tester-task.ya?ml" |
8 | 9 | - "go.mod"
|
9 | 10 | - "go.sum"
|
10 | | - - "**/*.go" |
11 | | - - "**/testdata/**" |
12 | | - - "etc/schemas/**/*.json" |
13 | | - - "pyproject.toml" |
14 | | - - "test/**" |
15 | | - - "Taskfile.yml" |
| 11 | + - "Taskfile.ya?ml" |
| 12 | + - "**.go" |
16 | 13 | pull_request:
|
17 | 14 | paths:
|
18 | | - - ".github/workflows/test.yml" |
19 | | - - "Taskfile.yml" |
| 15 | + - ".github/workflows/publish-go-tester-task.ya?ml" |
20 | 16 | - "go.mod"
|
21 | 17 | - "go.sum"
|
22 | | - - "**/*.go" |
23 | | - - "**/testdata/**" |
24 | | - - "etc/schemas/**/*.json" |
25 | | - - "pyproject.toml" |
26 | | - - "test/**" |
27 | | - - "Taskfile.yml" |
| 18 | + - "Taskfile.ya?ml" |
| 19 | + - "**.go" |
| 20 | + workflow_dispatch: |
| 21 | + repository_dispatch: |
28 | 22 |
|
29 | 23 | env:
|
| 24 | + # As defined by the Taskfile's DIST_DIR variable |
| 25 | + DIST_DIR: dist |
30 | 26 | BUILDS_ARTIFACT: build-artifacts
|
31 | 27 |
|
32 | 28 | jobs:
|
33 | | - test-go: |
34 | | - strategy: |
35 | | - matrix: |
36 | | - operating-system: |
37 | | - - ubuntu-latest |
38 | | - - windows-latest |
39 | | - - macOS-latest |
40 | | - |
41 | | - runs-on: ${{ matrix.operating-system }} |
42 | | - |
43 | | - steps: |
44 | | - - name: Checkout local repository |
45 | | - uses: actions/checkout@v2 |
46 | | - |
47 | | - - name: Install Go |
48 | | - uses: actions/setup-go@v2 |
49 | | - with: |
50 | | - go-version: "1.16" |
51 | | - |
52 | | - - name: Install Taskfile |
53 | | - uses: arduino/setup-task@v1 |
54 | | - with: |
55 | | - repo-token: ${{ secrets.GITHUB_TOKEN }} |
56 | | - version: 3.x |
57 | | - |
58 | | - - name: Generate code |
59 | | - run: task go:generate |
60 | | - |
61 | | - - name: Check for forgotten code generation |
62 | | - run: git diff --color --exit-code |
63 | | - |
64 | | - - name: Run unit tests |
65 | | - run: task go:test-unit |
66 | | - |
67 | | - - name: Send unit tests coverage to Codecov |
68 | | - if: matrix.operating-system == 'ubuntu-latest' |
69 | | - uses: codecov/codecov-action@v1 |
70 | | - with: |
71 | | - file: ./coverage_unit.txt |
72 | | - flags: unit |
73 | | - fail_ci_if_error: true |
74 | | - |
75 | | - - name: Install Python |
76 | | - uses: actions/setup-python@v2 |
77 | | - with: |
78 | | - python-version: "3.9" |
79 | | - |
80 | | - - name: Install Poetry |
81 | | - run: pip install poetry |
82 | | - |
83 | | - - name: Run integration tests |
84 | | - run: task test-integration |
85 | | - |
86 | 29 | build:
|
87 | 30 | runs-on: ubuntu-latest
|
88 | 31 |
|
89 | 32 | steps:
|
90 | 33 | - name: Checkout repository
|
91 | | - uses: actions/checkout@v1 |
| 34 | + uses: actions/checkout@v2 |
92 | 35 | with:
|
93 | 36 | fetch-depth: 0
|
94 | 37 |
|
|
112 | 55 | - name: Upload combined builds artifact
|
113 | 56 | uses: actions/upload-artifact@v2
|
114 | 57 | with:
|
115 | | - path: dist/ |
| 58 | + path: ${{ env.DIST_DIR }} |
116 | 59 | name: ${{ env.BUILDS_ARTIFACT }}
|
117 | 60 |
|
118 | 61 | artifacts:
|
|
0 commit comments