Have a separate workflow for test with correct file paths

This commit is contained in:
Salar Rahmanian 2025-02-08 20:14:50 -08:00
parent b3ab1e325f
commit 477af99eab
4 changed files with 39 additions and 41 deletions

View file

@ -1,36 +1,12 @@
name: Build and Test
name: Build and Release Artifacts
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types: [created]
types: [published]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Swift
uses: swift-actions/setup-swift@v2
with:
swift-version: '6.0'
- name: Get swift version
run: swift --version
- name: Run tests
run: swift test
build-macos:
runs-on: macos-latest
if: github.event_name == 'release'
strategy:
matrix:
arch: [x86_64, arm64]
@ -53,14 +29,13 @@ jobs:
cp .build/apple/Products/Release/fishee artifacts/macos-${{ matrix.arch }}/
- name: Upload macOS artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: fishee-macos-${{ matrix.arch }}-${{ github.ref_name }}
path: artifacts/macos-${{ matrix.arch }}
build-linux:
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- name: Checkout code
uses: actions/checkout@v3
@ -80,7 +55,7 @@ jobs:
cp .build/release/fishee artifacts/linux/
- name: Upload Linux artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: fishee-linux-${{ github.ref_name }}
path: artifacts/linux

30
.github/workflows/test.yml vendored Normal file
View file

@ -0,0 +1,30 @@
name: Run Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Swift
uses: swift-actions/setup-swift@v2
with:
swift-version: '6.0'
- name: Get swift version
run: swift --version
- name: Run tests
run: swift test