Add .gitea/workflows/swift-test.yml
This commit is contained in:
28
.gitea/workflows/swift-test.yml
Normal file
28
.gitea/workflows/swift-test.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
name: Swift Test
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
swift-hello:
|
||||
runs-on: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Swift if missing
|
||||
run: |
|
||||
if ! command -v swift >/dev/null; then
|
||||
# Download Swift 6.1 for Ubuntu 22.04
|
||||
wget https://download.swift.org/swift-6.1-release/ubuntu2204/swift-6.1-RELEASE/swift-6.1-RELEASE-ubuntu22.04.tar.gz
|
||||
tar xzf swift-6.1-RELEASE-ubuntu22.04.tar.gz
|
||||
# Add to PATH for this job
|
||||
export PATH="${PWD}/swift-6.1-RELEASE-ubuntu22.04/usr/bin:${PATH}"
|
||||
fi
|
||||
# Based on Swift.org’s Ubuntu 22.04 instructions :contentReference[oaicite:0]{index=0}
|
||||
|
||||
- name: Verify Swift installation
|
||||
run: swift --version
|
||||
|
||||
- name: Run “Hello, Swift!”
|
||||
run: |
|
||||
echo 'print("Hello, Swift!")' > main.swift
|
||||
swift main.swift
|
Reference in New Issue
Block a user