forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 3
108 lines (103 loc) · 3.36 KB
/
ports_psoc6.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: psoc6 port
on:
push:
pull_request:
paths:
- '.github/workflows/*.yml'
- 'tools/**'
- 'py/**'
- 'extmod/**'
- 'shared/**'
- 'lib/**'
- 'drivers/**'
- 'ports/psoc6/**'
jobs:
server-build:
runs-on: ubuntu-latest
strategy:
matrix:
board: [CY8CPROTO-062-4343W]
outputs:
commit_sha: ${{ steps.commit_sha.outputs.sha_short }}
steps:
- uses: actions/checkout@v3
- name: Install packages
run: source tools/ci.sh && ci_psoc6_setup
- name: Build
run: source tools/ci.sh && ci_psoc6_build ${{ matrix.board }}
# Steps only relevant for Infineon fork
# with self-hosted runner available
- name: Gets commit SHA
if: success() && github.repository_owner == 'infineon'
id: commit_sha
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Save firmware bin
if: success() && github.repository_owner == 'infineon'
uses: actions/upload-artifact@v3
with:
name: mpy-psoc6_${{ matrix.board }}_${{ steps.commit_sha.outputs.sha_short }}
path: ports/psoc6/build/firmware.hex
# Jobs only relevant for Infineon fork
on-target-test:
if: github.repository_owner == 'infineon'
runs-on: self-hosted
needs: server-build
strategy:
matrix:
board: [CY8CPROTO-062-4343W]
steps:
- uses: actions/checkout@v3
- name: Download binaries
uses: actions/download-artifact@v3
- name: Container setup
run: |
echo ${{ secrets.SELF_HOSTED_PASSWORD }} | sudo -S chmod 666 /var/run/docker.sock
source tools/ci.sh && ci_psoc6_setup
- name: Setup devices
run: |
cp mpy-psoc6_${{ matrix.board }}_${{ needs.server-build.outputs.commit_sha }}/firmware.hex .
source tools/ci.sh && ci_psoc6_flash_multiple_devices firmware.hex
- name: Run psoc6 multi test
run: |
cd tests
./psoc6/run_psoc6_tests.sh --psoc6-multi
- name: Run psoc6 tests
run: |
cd tests
./psoc6/run_psoc6_tests.sh --psoc6
# TODO: Enable when HIL is updgraded
# - name: Run all implemented tests
# if: github.event_name == 'pull_request'
# continue-on-error: true
# run: |
# cd tests
# ./psoc6/run_psoc6_tests.sh -i
- name: Container teardown
if: failure() || success()
run: |
source tools/ci.sh && ci_psoc6_teardown
release:
runs-on: ubuntu-latest
needs: [server-build, on-target-test]
strategy:
matrix:
board: [CY8CPROTO-062-4343W]
if: startsWith(github.ref, 'refs/tags/v') && github.repository_owner == 'infineon'
steps:
- name: Download binaries
uses: actions/download-artifact@v3
- name: Prepare release assets
run: |
cd mpy-psoc6_${{ matrix.board }}_${{ needs.server-build.outputs.commit_sha }}
mv firmware.hex ../mpy-psoc6_${{ matrix.board }}.hex
- name: Build release changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v1
with:
name: Micropython PSoC6 ${{ github.ref_name }}
files: mpy-psoc6_${{ matrix.board }}.hex
body: ${{steps.build_changelog.outputs.changelog}}