Skip to content

Commit e4ef571

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

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed

.github/workflows/xc32-sftp.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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.tar "http://ww1.microchip.com/downloads/en/DeviceDoc/MPLABX-v6.00-linux-installer.tar"
60+
61+
- name: Setup MPLABX
62+
run: |
63+
mkdir MPLABX
64+
cd MPLABX
65+
tar -xf /tmp/mplabx.tar
66+
echo "Installing MPLABX..."
67+
sudo ./MPLABX-v6.00-linux-installer.sh --nox11 -- --unattendedmodeui none --mode unattended --installdir /opt/microchip/mplabx
68+
69+
- uses: actions/checkout@v4
70+
with:
71+
path: wolfssh/
72+
73+
- name: Replace wolfssh source code
74+
run: |
75+
# Remove existing wolfssh directory if it exists
76+
if [ -d "net_apps_sam_e70_v71/apps/wolfssh_sftp_server_freertos/firmware/src/third_party/wolfssh" ]; then
77+
rm -rf net_apps_sam_e70_v71/apps/wolfssh_sftp_server_freertos/firmware/src/third_party/wolfssh
78+
fi
79+
# Copy the PR wolfssh code
80+
mkdir -p net_apps_sam_e70_v71/apps/wolfssh_sftp_server_freertos/firmware/src/third_party/wolfssh
81+
cp -R wolfssh/* net_apps_sam_e70_v71/apps/wolfssh_sftp_server_freertos/firmware/src/third_party/wolfssh/
82+
echo "Replaced wolfssh source code with current PR's source code"
83+
84+
- name: Generate and compile the project
85+
working-directory: net_apps_sam_e70_v71/apps/wolfssh_sftp_server_freertos/firmware
86+
run: |
87+
/opt/microchip/mplabx/mplab_platform/bin/prjMakefilesGenerator.sh wolfssh_sftp_server_freertos.X
88+
cd wolfssh_sftp_server_freertos.X
89+
make
90+

0 commit comments

Comments
 (0)