Skip to content

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
sinoru committed Jul 31, 2022
2 parents ccb3035 + cb1ddec commit b36fdf3
Show file tree
Hide file tree
Showing 15 changed files with 539 additions and 1 deletion.
78 changes: 78 additions & 0 deletions .github/workflows/action-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Copyright (c) 2022 Jaehong Kang
# Licensed under Apache License v2.0

name: Action Tests

on:
push:
paths:
- '.github/workflows/action-tests.yml'
- 'action.yml'
- 'swift'
- 'libexec/**/*'
- 'action-tests/**/*'
pull_request:
paths-ignore:
- '.github/workflows/action-tests.yml'
- 'action.yml'
- 'swift'
- 'libexec/**/*'
- 'action-tests/**/*'

jobs:
tests-with-docker:
name: Tests w/ Docker
strategy:
fail-fast: true
matrix:
operating-system: ["ubuntu-latest"]
swift-image-tag: [
"5.6-bionic",
"5.6-focal",
"5.6-centos7",
"5.5-bionic",
"5.5-focal",
"5.5-centos7",
"5.4-bionic",
"5.4-focal",
"5.4-centos7",
]
runs-on: ${{ matrix.operating-system }}
steps:
- uses: actions/checkout@v3
- uses: ./
with:
swift-image-tag: ${{ matrix.swift-image-tag }}
args: build --package-path action-tests --product Warning

tests-without-docker:
name: Tests w/o Docker
strategy:
fail-fast: true
matrix:
operating-system: ["ubuntu-18.04", "ubuntu-20.04"]
swift-version: ["5.4.3", "5.5.3", "5.6.2"]
include:
- operating-system: "macos-12"
swift-version: "5.6.2"
xcode-version: "13.4.1"
- operating-system: "macos-12"
swift-version: "5.5.3"
xcode-version: "13.2.1"
- operating-system: "macos-11"
swift-version: "5.4.3"
xcode-version: "12.5.1"
runs-on: ${{ matrix.operating-system }}
steps:
- uses: actions/checkout@v3
- uses: sinoru/actions-setup-xcode@v2
if: ${{ startsWith(runner.os, 'macOS') && matrix.xcode-version }}
with:
xcode-version: ${{ matrix.xcode-version }}
apple-id: ${{ secrets.APPLE_ID }}
apple-id-password: ${{ secrets.APPLE_ID_PASSWORD }}
- uses: ./
with:
swift-image-tag: null
swift-version: ${{ matrix.swift-version }}
args: build --package-path action-tests --product Warning
39 changes: 39 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright (c) 2022 Jaehong Kang
# Licensed under Apache License v2.0

name: Unit Tests

on:
push:
paths:
- '.github/workflows/unit-tests.yml'
- 'libexec/**/*'
- 'unit-tests/**/*'
pull_request:
paths-ignore:
- '.github/workflows/unit-tests.yml'
- 'libexec/**/*'
- 'unit-tests/**/*'

jobs:
warning:
name: Warning
strategy:
fail-fast: true
matrix:
operating-system: ["ubuntu-latest"]
swift-version: ["5.4.3", "5.5.3", "5.6.2"]
include:
- operating-system: "macos-12"
swift-version: "5.6.2"
xcode-version: "13.4.1"
- operating-system: "macos-12"
swift-version: "5.5.3"
xcode-version: "13.2.1"
- operating-system: "macos-11"
swift-version: "5.4.3"
xcode-version: "12.5.1"
runs-on: ${{ matrix.operating-system }}
steps:
- uses: actions/checkout@v3
- run: diff <(cat unit-tests/warning-source.txt | libexec/github-action-output-handler) unit-tests/warning-expected.txt
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.0.0]
This is the initial release.

[Unreleased]: https://github.com/sinoru/swift-snowflake/compare/v1.0.0...HEAD
[1.0.0]: https://github.com/sinoru/swift-snowflake/releases/tag/v1.0.0
48 changes: 47 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,47 @@
# actions-swift
# GitHub Action for Swift

This action executes [Swift](https://swift.org) and generates github action annotations from swift warnings/errors.

## Usage

An example to executing Swift follows:

```yaml
name: Swift

on:
push:
paths:
- '.github/workflows/swift.yml' # File path to this yaml
- '**/*.swift'
pull_request:
paths:
- '.github/workflows/swift.yml' # File path to this yaml
- '**/*.swift'

jobs:
swift-on-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: sinoru/actions-swift@v1
with:
swift-image-tag: '5.6'
args: 'build'
- uses: sinoru/actions-swift@v1
with:
swift-image-tag: '5.6'
args: 'test'

swift-without-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: sinoru/actions-swift@v1
with:
swift-version: '5.6.3'
args: 'build'
- uses: sinoru/actions-swift@v1
with:
args: 'test'
```
167 changes: 167 additions & 0 deletions action-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# Created by https://www.toptal.com/developers/gitignore/api/macos,windows,linux,swift,swiftpm
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,windows,linux,swift,swiftpm

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### Swift ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3

## Obj-C/Swift specific
*.hmap

## App packaging
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm

.build/

# CocoaPods
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
# Pods/
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace

# Carthage
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build/

# Accio dependency management
Dependencies/
.accio/

# fastlane
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/

### SwiftPM ###
Packages
xcuserdata
*.xcodeproj


### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/macos,windows,linux,swift,swiftpm
Expand Down
25 changes: 25 additions & 0 deletions action-tests/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// swift-tools-version:5.4
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "actions-swift-tests",
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.executableTarget(
name: "Warning",
dependencies: []),
.executableTarget(
name: "Error",
dependencies: []),
.testTarget(
name: "FailTests",
dependencies: []),
]
)
3 changes: 3 additions & 0 deletions action-tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# actions-swift-tests

A description of this package.
3 changes: 3 additions & 0 deletions action-tests/Sources/Error/main.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#error("A error message for tests.")
#error("A error message for tests.")
#error("A error message for tests.")
3 changes: 3 additions & 0 deletions action-tests/Sources/Warning/main.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#warning("A warning message for tests.")
#warning("A warning message for tests.")
#warning("A warning message for tests.")
Loading

0 comments on commit b36fdf3

Please sign in to comment.