Skip to content

Commit 38ab023

Browse files
add compile time test with xc32 compiler
1 parent 5fb496b commit 38ab023

1 file changed

Lines changed: 92 additions & 0 deletions

File tree

.github/workflows/xc32-sftp.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: XC32 Build
2+
3+
on:
4+
push:
5+
branches: [ '*' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
jobs:
10+
wolfssh-xc32:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout app repository
14+
uses: actions/checkout@v3
15+
with:
16+
repository: JacobBarthelmeh/net_apps_sam_e70_v71
17+
ref: sftp_server
18+
path: net_apps_sam_e70_v71
19+
20+
- name: Set up environment
21+
run: |
22+
sudo apt-get update
23+
sudo apt-get install -y libcurl4-openssl-dev libarchive-dev libelf-dev
24+
25+
# Cache XC32 compiler installer
26+
- name: Cache XC32 compiler installer
27+
id: cache-xc32
28+
uses: actions/cache@v3
29+
with:
30+
path: /tmp/xc32.run
31+
key: ${{ runner.os }}-xc32-installer
32+
33+
- name: Download XC32 compiler
34+
if: steps.cache-xc32.outputs.cache-hit != 'true'
35+
run: |
36+
echo "Downloading XC32 compiler..."
37+
curl -fSL -A "Mozilla/4.0" -o /tmp/xc32.run "https://ww1.microchip.com/downloads/aemDocuments/documents/DEV/ProductDocuments/SoftwareTools/xc32-v4.60-full-install-linux-x64-installer.run"
38+
39+
- name: Setup XC32 compiler
40+
run: |
41+
chmod a+x /tmp/xc32.run
42+
echo "Installing XC32 compiler..."
43+
sudo /tmp/xc32.run --mode unattended --unattendedmodeui none --netservername localhost --LicenseType FreeMode --prefix /opt/microchip/xc32
44+
# Add compiler to PATH
45+
echo "PATH=$PATH:/opt/microchip/xc32/v4.60/bin" >> $GITHUB_ENV
46+
47+
# Cache MPLABX installer
48+
- name: Cache MPLABX compiler installer
49+
id: cache-mplabx
50+
uses: actions/cache@v3
51+
with:
52+
path: /tmp/mplabx.run
53+
key: ${{ runner.os }}-mplabx-installer
54+
55+
- name: Download MPLABX
56+
if: steps.cache-mplabx.outputs.cache-hit != 'true'
57+
run: |
58+
echo "Downloading MPLABX..."
59+
curl -fSL -A "Mozilla/4.0" -o /tmp/mplabx.run "https://ww1.microchip.com/downloads/aemDocuments/documents/DEV/ProductDocuments/SoftwareTools/MPLABX-v6.25-linux-installer.tar"
60+
61+
- name: Setup MPLABX
62+
run: |
63+
chmod a+x /tmp/mplabx.run
64+
echo "Installing MPLABX..."
65+
sudo /tmp/mplabx.run --mode unattended --unattendedmodeui none --prefix /opt/microchip/mplabx
66+
ls /opt/microchip/mplabx/
67+
ls /opt/microchip/mplabx/v6.25
68+
# Add to PATH
69+
echo "PATH=$PATH:/opt/microchip/mplabx/v6.25/bin" >> $GITHUB_ENV
70+
71+
- uses: actions/checkout@v4
72+
with:
73+
path: wolfssh/
74+
75+
- name: Replace wolfssh source code
76+
run: |
77+
# Remove existing wolfssh directory if it exists
78+
if [ -d "net_apps_sam_e70_v71/apps/wolfssh_sftp_server_freertos/firmware/src/third_party/wolfssh" ]; then
79+
rm -rf net_apps_sam_e70_v71/apps/wolfssh_sftp_server_freertos/firmware/src/third_party/wolfssh
80+
fi
81+
# Copy the PR wolfssh code
82+
mkdir -p net_apps_sam_e70_v71/apps/wolfssh_sftp_server_freertos/firmware/src/third_party/wolfssh
83+
cp -R wolfssh/* net_apps_sam_e70_v71/apps/wolfssh_sftp_server_freertos/firmware/src/third_party/wolfssh/
84+
echo "Replaced wolfssh source code with current PR's source code"
85+
86+
- name: Generate and compile the project
87+
working-directory: net_apps_sam_e70_v71/apps/wolfssh_sftp_server_freertos/firmware
88+
run: |
89+
/opt/microchip/mplabx/v6.25/mplab_platform/bin/prjMakefilesGenerator.sh wolfssh_sftp_server_freertos.X
90+
cd wolfssh_sftp_server_freertos.X
91+
make
92+

0 commit comments

Comments
 (0)