Skip to content

Commit 6151950

Browse files
authored
Merge branch 'swiftlang:main' into main
2 parents 1e1a92e + 3ae6261 commit 6151950

37 files changed

+4368
-564
lines changed

.github/actions/install-swift/action.yml

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ description: Installs the Swift specified by a .swift-version file
44
runs:
55
using: "composite"
66
steps:
7-
# - name: "Cache: Swift"
8-
# id: cache-swift
9-
# uses: actions/cache@v4
10-
# with:
11-
# path: "$HOME/.local/share/swiftly"
12-
# key: swift-${{ hashFiles('.swift-version') }}
13-
147
- name: Setup Environment
158
shell: bash
169
run: |
10+
mkdir -p "$HOME/.local/share"
11+
12+
export SWIFTLY_TOOLCHAINS_DIR="$HOME/.local/share/swiftly/toolchains"
13+
echo "SWIFTLY_TOOLCHAINS_DIR=$SWIFTLY_TOOLCHAINS_DIR" >> $GITHUB_ENV
14+
echo "SWIFTLY_TOOLCHAINS_DIR=$SWIFTLY_TOOLCHAINS_DIR" >> $HOME/.bashrc
15+
1716
export SWIFTLY_HOME_DIR="$HOME/.local/share/swiftly"
1817
echo "SWIFTLY_HOME_DIR=$SWIFTLY_HOME_DIR" >> $GITHUB_ENV
1918
echo "SWIFTLY_HOME_DIR=$SWIFTLY_HOME_DIR" >> $HOME/.bashrc
@@ -25,15 +24,15 @@ runs:
2524
echo "PATH=$SWIFTLY_BIN_DIR:$PATH" >> $GITHUB_ENV
2625
echo "PATH=\$SWIFTLY_BIN_DIR:\$PATH" >> $HOME/.bashrc
2726
28-
- name: "Restore: Swift"
27+
- name: Restore Swift
2928
uses: actions/cache/restore@v4
3029
id: cache-swift
3130
with:
3231
path: "~/.local/share/swiftly"
33-
key: swift-${{ hashFiles('**/.swift-version') }}
32+
key: swift-${{ runner.os }}-${{ hashFiles('**/.swift-version', '.github/actions/install-swift/action.yml') }}
3433

3534
- name: Install `apt` Dependencies
36-
if: steps.cache-swift.outputs.cache-hit != 'true'
35+
if: runner.os == 'Linux' && steps.cache-swift.outputs.cache-hit != 'true'
3736
shell: bash
3837
run: |
3938
SUDO=$(if [[ $EUID -ne 0 ]]; then echo sudo; fi)
@@ -43,29 +42,47 @@ runs:
4342
DEBIAN_FRONTEND: noninteractive
4443

4544
- name: Install Swiftly
46-
if: steps.cache-swift.outputs.cache-hit != 'true'
45+
if: runner.os == 'Linux' && steps.cache-swift.outputs.cache-hit != 'true'
4746
shell: bash
4847
run: |
48+
SWIFTLY_VERSION=1.0.1
4949
UNAME=$(uname -m)
50-
curl -O "https://download.swift.org/swiftly/linux/swiftly-$UNAME.tar.gz"
51-
tar zxf "swiftly-$UNAME.tar.gz"
50+
SWIFTLY_TGZ=swiftly-$SWIFTLY_VERSION-$UNAME.tar.gz
51+
curl -O "https://download.swift.org/swiftly/linux/$SWIFTLY_TGZ"
52+
tar zxf "$SWIFTLY_TGZ"
5253
./swiftly init \
5354
--skip-install \
5455
--assume-yes \
5556
--quiet-shell-followup \
5657
--no-modify-profile
5758
59+
- name: Install Swiftly
60+
if: runner.os == 'macOS' && steps.cache-swift.outputs.cache-hit != 'true'
61+
shell: bash
62+
run: |
63+
SWIFTLY_VERSION=1.0.1
64+
SWIFTLY_PKG=swiftly-$SWIFTLY_VERSION.pkg
65+
curl -O "https://download.swift.org/swiftly/darwin/$SWIFTLY_PKG"
66+
pkgutil --check-signature $SWIFTLY_PKG
67+
pkgutil --verbose --expand $SWIFTLY_PKG $SWIFTLY_HOME_DIR
68+
tar -C $SWIFTLY_HOME_DIR -xvf $SWIFTLY_HOME_DIR/swiftly-*/Payload
69+
"$SWIFTLY_BIN_DIR/swiftly" init \
70+
--skip-install \
71+
--assume-yes \
72+
--quiet-shell-followup \
73+
--no-modify-profile
74+
5875
- name: Install Swift
5976
if: steps.cache-swift.outputs.cache-hit != 'true'
6077
shell: bash
6178
run: swiftly install --post-install-file ./out.sh
6279

63-
- name: "Save: Swift"
80+
- name: Save Swift
6481
if: steps.cache-swift.outputs.cache-hit != 'true'
6582
uses: actions/cache/save@v4
6683
with:
6784
path: "~/.local/share/swiftly"
68-
key: swift-${{ hashFiles('**/.swift-version') }}
85+
key: swift-${{ runner.os }}-${{ hashFiles('**/.swift-version', '.github/actions/install-swift/action.yml') }}
6986

7087
- name: Print Swift Version
7188
shell: bash

.github/workflows/build-esp.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: ESP
22

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
58
branches: ["main"]

.github/workflows/build-nuttx.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: NuttX
22

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
58
branches: ["main"]

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Raspberry Pi Baremetal
22

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
58
branches: ["main"]

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Raspberry Pi Pico SDK
22

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
58
branches: ["main"]
@@ -12,6 +15,10 @@ jobs:
1215
name: Build
1316
runs-on: ubuntu-24.04
1417

18+
env:
19+
PICO_SDK_VERSION: "2.2.0"
20+
PICO_EXTRAS_VERSION: "sdk-2.2.0"
21+
1522
strategy:
1623
fail-fast: false
1724
matrix:
@@ -50,17 +57,13 @@ jobs:
5057

5158
- name: Clone Pico SDK
5259
run: |
53-
git clone https://github.com/raspberrypi/pico-sdk.git
54-
cd pico-sdk
55-
git submodule update --init --recursive
56-
cd ..
60+
git clone --depth 1 --branch ${{ env.PICO_SDK_VERSION }} https://github.com/raspberrypi/pico-sdk.git
61+
git -C pico-sdk submodule update --init --recursive
5762
5863
- name: Clone Pico Extras
5964
run: |
60-
git clone https://github.com/raspberrypi/pico-extras.git
61-
cd pico-extras
62-
git submodule update --init --recursive
63-
cd ..
65+
git clone --depth 1 --branch ${{ env.PICO_EXTRAS_VERSION }} https://github.com/raspberrypi/pico-extras.git
66+
git -C pico-extras submodule update --init --recursive
6467
6568
- name: Set Pico environment variables
6669
run: |
Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
name: STM32
1+
name: STM32 ELF
2+
3+
permissions:
4+
contents: read
25

36
on:
47
push:
@@ -15,16 +18,12 @@ jobs:
1518
strategy:
1619
fail-fast: false
1720
matrix:
18-
example: [stm32-blink, stm32-lvgl]
21+
example: [stm32-lvgl]
1922

2023
steps:
2124
- name: Checkout repo
2225
uses: actions/checkout@v4
2326

24-
- name: Fixup for running locally in act
25-
if: ${{ env.ACT }}
26-
run: echo /opt/acttoolcache/node/18.20.8/x64/bin >> $GITHUB_PATH
27-
2827
- name: Set up Python
2928
uses: actions/setup-python@v5
3029
with:
@@ -36,21 +35,11 @@ jobs:
3635
- name: Install Swift
3736
uses: ./.github/actions/install-swift
3837

39-
- name: Set environment variables
40-
run: |
41-
echo "STM_BOARD=STM32F746G_DISCOVERY" >> $GITHUB_ENV
42-
4338
- name: Build ${{ matrix.example }}
4439
working-directory: ${{ matrix.example }}
4540
run: |
4641
if [[ -f ./fetch-dependencies.sh ]]; then
4742
./fetch-dependencies.sh
4843
fi
4944
50-
if [[ -f ./build-elf.sh ]]; then
51-
./build-elf.sh
52-
fi
53-
54-
if [[ -f Makefile ]]; then
55-
make
56-
fi
45+
make
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: STM32 Macho
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches: ["main"]
9+
pull_request:
10+
types: [opened, reopened, synchronize, ready_for_review]
11+
workflow_dispatch:
12+
13+
jobs:
14+
build:
15+
name: Build
16+
runs-on: [self-hosted, macos, sequoia, ARM64]
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
example: [stm32-blink, stm32-lcd-logo, stm32-neopixel, stm32-uart-echo]
22+
23+
steps:
24+
- name: Checkout repo
25+
uses: actions/checkout@v4
26+
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v5
29+
with:
30+
python-version: 3.11
31+
32+
- name: Install Swift
33+
uses: ./.github/actions/install-swift
34+
35+
- name: Build ${{ matrix.example }}
36+
working-directory: ${{ matrix.example }}
37+
run: make

.github/workflows/build-zephyr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Zephyr
22

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
58
branches: ["main"]

.github/workflows/lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Lint
22

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
58
branches: ["main"]

.github/workflows/update-swift-version.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Update Swift Version
22

3+
permissions:
4+
contents: read
5+
36
on:
47
schedule:
58
- cron: '0 0 */7 * *' # Every 7 days at midnight UTC

0 commit comments

Comments
 (0)