Skip to content

Commit 86dd858

Browse files
committed
wip
1 parent 2426131 commit 86dd858

File tree

7 files changed

+67
-154
lines changed

7 files changed

+67
-154
lines changed
Lines changed: 30 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,35 @@
1-
2-
name: 'Hello World'
3-
description: 'Greet someone'
4-
5-
inputs:
6-
who-to-greet:
7-
description: 'Who to greet'
8-
required: true
9-
default: 'World'
10-
11-
outputs:
12-
random-number:
13-
description: "Random number"
14-
value: ${{ steps.random-number-generator.outputs.random-number }}
1+
name: 'Install Swift'
2+
description: 'Installs the Swift specified by a .swift-version file'
153

164
runs:
175
using: "composite"
186
steps:
19-
- name: Set Greeting
20-
run: echo "Hello $INPUT_WHO_TO_GREET."
21-
env:
22-
INPUT_WHO_TO_GREET: ${{ inputs.who-to-greet }}
23-
24-
- name: Random Number Generator
25-
id: random-number-generator
26-
run: echo "random-number=$(echo $RANDOM)" >> $GITHUB_OUTPUT
27-
28-
- name: Set GitHub Path
29-
run: echo "$GITHUB_ACTION_PATH" >> $GITHUB_PATH
7+
- name: Install apt dependencies
8+
run: |
9+
apt-get -qq update
10+
apt-get -qq -y install curl gpg binutils git unzip gnupg2 libc6-dev \
11+
libcurl4-openssl-dev libedit2 libgcc-13-dev libpython3-dev \
12+
libstdc++-13-dev libxml2-dev libncurses-dev libz3-dev pkg-config \
13+
tzdata zlib1g-dev
3014
env:
31-
GITHUB_ACTION_PATH: ${{ github.action_path }}
32-
33-
# - name: Install apt dependencies
34-
# run: apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install curl gpg binutils git unzip gnupg2 libc6-dev libcurl4-openssl-dev libedit2 libgcc-13-dev libpython3-dev libstdc++-13-dev libxml2-dev libncurses-dev libz3-dev pkg-config tzdata zlib1g-dev
35-
36-
# - name: Install Swiftly
37-
# run: |
38-
# curl -O "https://download.swift.org/swiftly/linux/swiftly-$(uname -m).tar.gz"
39-
# tar zxf "swiftly-$(uname -m).tar.gz"
40-
# ./swiftly init --skip-install --assume-yes
41-
42-
# export SWIFTLY_HOME_DIR="$HOME/.local/share/swiftly"
43-
# echo "SWIFTLY_HOME_DIR=$SWIFTLY_HOME_DIR" >> $GITHUB_ENV
44-
45-
# export SWIFTLY_BIN_DIR="$HOME/.local/share/swiftly/bin"
46-
# echo "SWIFTLY_BIN_DIR=$SWIFTLY_BIN_DIR" >> $GITHUB_ENV
47-
48-
# export PATH="$SWIFTLY_BIN_DIR:$PATH"
49-
# echo "PATH=$PATH" >> $GITHUB_ENV
50-
51-
# - name: Install Swift
52-
# run: |
53-
# set -ex
54-
# ls /root/.local/share/swiftly/bin
55-
# echo $PATH
56-
# echo which swiftly
57-
# which swiftly
58-
59-
# swiftly install
60-
# swift --version
15+
DEBIAN_FRONTEND: noninteractive
16+
17+
- name: Install Swiftly
18+
run: |
19+
curl -O "https://download.swift.org/swiftly/linux/swiftly-$(uname -m).tar.gz"
20+
tar zxf "swiftly-$(uname -m).tar.gz"
21+
./swiftly init --skip-install --assume-yes --quiet-shell-followup
22+
23+
export SWIFTLY_HOME_DIR="$HOME/.local/share/swiftly"
24+
echo "SWIFTLY_HOME_DIR=$SWIFTLY_HOME_DIR" >> $GITHUB_ENV
25+
26+
export SWIFTLY_BIN_DIR="$HOME/.local/share/swiftly/bin"
27+
echo "SWIFTLY_BIN_DIR=$SWIFTLY_BIN_DIR" >> $GITHUB_ENV
28+
29+
export PATH="$SWIFTLY_BIN_DIR:$PATH"
30+
echo "PATH=$PATH" >> $GITHUB_ENV
31+
32+
- name: Install Swift
33+
run: |
34+
swiftly install
35+
swift --version

.github/workflows/build-esp.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
build-esp:
1414
runs-on: ubuntu-24.04
1515
container: espressif/idf:latest
16+
1617
strategy:
1718
fail-fast: false
1819
matrix:
1920
example: [esp32-led-blink-sdk, esp32-led-strip-sdk]
20-
swift: [swift-DEVELOPMENT-SNAPSHOT-2024-12-04-a]
2121

2222
steps:
2323
- name: Checkout repo
@@ -26,13 +26,8 @@ jobs:
2626
- name: Install apt dependencies
2727
run: apt-get -qq update && apt-get -qq -y install pkg-config
2828

29-
- name: Install ${{ matrix.swift }}
30-
run: |
31-
wget -q https://download.swift.org/development/ubuntu2404/${{ matrix.swift }}/${{ matrix.swift }}-ubuntu24.04.tar.gz
32-
tar xzf ${{ matrix.swift }}-ubuntu24.04.tar.gz
33-
export PATH="`pwd`/${{ matrix.swift }}-ubuntu24.04/usr/bin/:$PATH"
34-
echo "PATH=$PATH" >> $GITHUB_ENV
35-
swiftc --version
29+
- name: Install Swift
30+
uses: ./.github/actions/install-swift
3631

3732
- name: Build ${{ matrix.example }}
3833
run: |

.github/workflows/build-nuttx.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
example: [nuttx-riscv-blink]
20-
swift: [swift-DEVELOPMENT-SNAPSHOT-2024-12-22-a]
2120

2221
steps:
2322
- name: Checkout repo
@@ -50,18 +49,11 @@ jobs:
5049
echo "PATH=$PATH" >> $GITHUB_ENV
5150
riscv-none-elf-gcc --version
5251
53-
- name: Install ${{ matrix.swift }}
54-
run: |
55-
wget -q https://download.swift.org/development/ubuntu2404/${{ matrix.swift }}/${{ matrix.swift }}-ubuntu24.04.tar.gz
56-
tar xzf ${{ matrix.swift }}-ubuntu24.04.tar.gz
57-
export PATH="`pwd`/${{ matrix.swift }}-ubuntu24.04/usr/bin/:$PATH"
58-
echo "PATH=$PATH" >> $GITHUB_ENV
59-
swiftc --version
60-
61-
- name: Config ${{ matrix.example }}
62-
working-directory: ${{ matrix.example }}
63-
run: cmake -B build -GNinja -DBOARD_CONFIG=rv-virt:leds_swift -DENABLE_NUTTX_TRACE=ON
64-
52+
- name: Install Swift
53+
uses: ./.github/actions/install-swift
54+
6555
- name: Build ${{ matrix.example }}
6656
working-directory: ${{ matrix.example }}
67-
run: cmake --build build
57+
run: |
58+
cmake -B build -GNinja -DBOARD_CONFIG=rv-virt:leds_swift -DENABLE_NUTTX_TRACE=ON
59+
cmake --build build

.github/workflows/build-pico-sdk.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
jobs:
1313
build-pico-sdk:
1414
runs-on: ubuntu-24.04
15+
1516
strategy:
1617
fail-fast: false
1718
matrix:
@@ -22,7 +23,6 @@ jobs:
2223
board: pico_w
2324
- name: harmony
2425
board: pico_w
25-
swift: [swift-DEVELOPMENT-SNAPSHOT-2024-12-04-a]
2626

2727
steps:
2828
- name: Checkout repo
@@ -46,15 +46,9 @@ jobs:
4646
curl -sL https://developer.arm.com/-/media/Files/downloads/gnu/14.2.rel1/binrel/arm-gnu-toolchain-14.2.rel1-$ARCH-arm-none-eabi.tar.xz -O
4747
tar xf arm-gnu-toolchain-14.2.rel1-$ARCH-arm-none-eabi.tar.xz
4848
49-
- name: Install ${{ matrix.swift }}
50-
run: |
51-
wget -q https://download.swift.org/development/ubuntu2404/${{ matrix.swift }}/${{ matrix.swift }}-ubuntu24.04.tar.gz
52-
tar xzf ${{ matrix.swift }}-ubuntu24.04.tar.gz
53-
export PATH="`pwd`/${{ matrix.swift }}-ubuntu24.04/usr/bin/:$PATH"
54-
echo "PATH=$PATH" >> $GITHUB_ENV
55-
which swiftc
56-
swiftc --version
57-
49+
- name: Install Swift
50+
uses: ./.github/actions/install-swift
51+
5852
- name: Clone Pico SDK
5953
run: |
6054
git clone https://github.com/raspberrypi/pico-sdk.git
@@ -78,7 +72,7 @@ jobs:
7872
echo "PICO_TOOLCHAIN_PATH=`pwd`/arm-gnu-toolchain-14.2.rel1-$ARCH-arm-none-eabi" >> $GITHUB_ENV
7973
8074
- name: Build ${{ matrix.example.name }}
75+
working-directory: ${{ matrix.example.name }}
8176
run: |
82-
cd ${{ matrix.example.name }}
8377
cmake -B build -G Ninja .
8478
cmake --build build

.github/workflows/build-rpi-baremetal.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,26 @@ on:
88
schedule:
99
# Build on Mondays at 9am PST every week
1010
- cron: '0 17 * * 1'
11+
1112
jobs:
1213
build-rpi-baremetal:
1314
runs-on: ubuntu-24.04
15+
1416
strategy:
1517
fail-fast: false
1618
matrix:
17-
example: [rpi5-blink, rpi4b-blink]
18-
swift: [swift-DEVELOPMENT-SNAPSHOT-2024-12-04-a]
19+
example: [rpi4b-blink, rpi5-blink]
1920

2021
steps:
2122
- name: Checkout repo
2223
uses: actions/checkout@v4
2324

2425
- name: Install apt dependencies
25-
run: sudo apt-get -qq update && sudo apt-get -qq -y install make llvm
26+
run: apt-get -qq update && apt-get -qq -y install make llvm
2627

27-
- name: Install ${{ matrix.swift }}
28-
run: |
29-
wget -q https://download.swift.org/development/ubuntu2404/${{ matrix.swift }}/${{ matrix.swift }}-ubuntu24.04.tar.gz
30-
tar xzf ${{ matrix.swift }}-ubuntu24.04.tar.gz
31-
export PATH="`pwd`/${{ matrix.swift }}-ubuntu24.04/usr/bin/:$PATH"
32-
echo "PATH=$PATH" >> $GITHUB_ENV
33-
which swiftc
34-
swiftc --version
28+
- name: Install Swift
29+
uses: ./.github/actions/install-swift
3530

3631
- name: Build ${{ matrix.example }}
37-
run: |
38-
cd ${{ matrix.example }}
39-
make
32+
working-directory: ${{ matrix.example }}
33+
run: make

.github/workflows/build-stm.yml

Lines changed: 13 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -19,53 +19,22 @@ jobs:
1919
example: [stm32-blink]
2020

2121
steps:
22-
# - name: Checkout repo
23-
# uses: actions/checkout@v4
22+
- name: Checkout repo
23+
uses: actions/checkout@v4
2424

25-
# - name: Set up Python
26-
# uses: actions/setup-python@v5
27-
# with:
28-
# python-version: 3.11
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: 3.11
2929

30-
# - name: Install uv
31-
# uses: astral-sh/setup-uv@v5
30+
- name: Install uv
31+
uses: astral-sh/setup-uv@v5
3232

3333
- name: Install Swift
3434
uses: ./.github/actions/install-swift
35-
with:
36-
who-to-greet: 'Mona the Octocat'
37-
38-
# - name: Install apt dependencies
39-
# run: apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install curl gpg binutils git unzip gnupg2 libc6-dev libcurl4-openssl-dev libedit2 libgcc-13-dev libpython3-dev libstdc++-13-dev libxml2-dev libncurses-dev libz3-dev pkg-config tzdata zlib1g-dev
40-
41-
# - name: Install Swiftly
42-
# run: |
43-
# curl -O "https://download.swift.org/swiftly/linux/swiftly-$(uname -m).tar.gz"
44-
# tar zxf "swiftly-$(uname -m).tar.gz"
45-
# ./swiftly init --skip-install --assume-yes
46-
47-
# export SWIFTLY_HOME_DIR="$HOME/.local/share/swiftly"
48-
# echo "SWIFTLY_HOME_DIR=$SWIFTLY_HOME_DIR" >> $GITHUB_ENV
49-
50-
# export SWIFTLY_BIN_DIR="$HOME/.local/share/swiftly/bin"
51-
# echo "SWIFTLY_BIN_DIR=$SWIFTLY_BIN_DIR" >> $GITHUB_ENV
52-
53-
# export PATH="$SWIFTLY_BIN_DIR:$PATH"
54-
# echo "PATH=$PATH" >> $GITHUB_ENV
55-
56-
# - name: Install Swift
57-
# run: |
58-
# set -ex
59-
# ls /root/.local/share/swiftly/bin
60-
# echo $PATH
61-
# echo which swiftly
62-
# which swiftly
63-
64-
# swiftly install
65-
# swift --version
6635

67-
# - name: Build ${{ matrix.example }}
68-
# working-directory: ${{ matrix.example }}
69-
# run: |
70-
# export STM_BOARD=STM32F746G_DISCOVERY
71-
# ./build-elf.sh
36+
- name: Build ${{ matrix.example }}
37+
working-directory: ${{ matrix.example }}
38+
run: |
39+
export STM_BOARD=STM32F746G_DISCOVERY
40+
./build-elf.sh

.github/workflows/build-zephyr.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
example: [nrfx-blink-sdk]
20-
swift: [swift-DEVELOPMENT-SNAPSHOT-2024-12-04-a]
2120

2221
steps:
2322
- name: Checkout repo
@@ -34,13 +33,8 @@ jobs:
3433
app-path: ${{ matrix.example }}
3534
toolchains: arm-zephyr-eabi
3635

37-
- name: Install ${{ matrix.swift }}
38-
run: |
39-
wget -q https://download.swift.org/development/ubuntu2404/${{ matrix.swift }}/${{ matrix.swift }}-ubuntu24.04.tar.gz
40-
tar xzf ${{ matrix.swift }}-ubuntu24.04.tar.gz
41-
export PATH="`pwd`/${{ matrix.swift }}-ubuntu24.04/usr/bin/:$PATH"
42-
echo "PATH=$PATH" >> $GITHUB_ENV
43-
swiftc --version
36+
- name: Install Swift
37+
uses: ./.github/actions/install-swift
4438

4539
- name: Build ${{ matrix.example }}
4640
working-directory: ${{ matrix.example }}

0 commit comments

Comments
 (0)