Skip to content

Commit

Permalink
Switch from travis to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
djbe committed Jul 27, 2022
1 parent 93ee8e9 commit 0bcf1ad
Show file tree
Hide file tree
Showing 8 changed files with 214 additions and 22 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
25 changes: 25 additions & 0 deletions .github/workflows/danger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Danger

on:
push:
branches: master
pull_request:

jobs:
check:
name: Danger Check
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
-
name: Run Danger
run: bundle exec danger --verbose --dangerfile=rakelib/Dangerfile
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.danger_github_api_token }}
23 changes: 23 additions & 0 deletions .github/workflows/lint-cocoapods.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Lint Cocoapods

on:
push:
branches: master
pull_request:

jobs:
lint:
name: Pod Lint
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
-
name: Lint podspec
run: bundle exec rake pod:lint
23 changes: 23 additions & 0 deletions .github/workflows/release-check-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Check Versions

on:
push:
branches:
- 'release/**'

jobs:
check_versions:
name: Check Versions
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
-
name: Check versions
run: bundle exec rake release:check_versions
26 changes: 26 additions & 0 deletions .github/workflows/swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: SwiftLint

on:
push:
branches: master
pull_request:

jobs:
lint:
name: SwiftLint
runs-on: macos-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
-
name: Lint source code
run: bundle exec rake lint:code
-
name: Lint tests source code
run: bundle exec rake lint:tests
44 changes: 44 additions & 0 deletions .github/workflows/tag-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish on Tag

on:
push:
tags:
- '*'
workflow_dispatch:

jobs:
cocoapods:
name: Push To CocoaPods
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
-
name: Push to CocoaPods
run: bundle exec rake release:cocoapods
env:
COCOAPODS_TRUNK_TOKEN: ${{secrets.COCOAPODS_TRUNK_TOKEN}}

github:
name: GitHub Release
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
-
name: Create release on GitHub
run: bundle exec rake release:github
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.danger_github_api_token }}
66 changes: 66 additions & 0 deletions .github/workflows/test-spm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Test SPM

on:
push:
branches: master
pull_request:

jobs:
linux:
name: Test SPM Linux
runs-on: ubuntu-latest
container: swiftgen/swift:5.6
steps:
-
name: Checkout
uses: actions/checkout@v3
-
# Note: we can't use `ruby/setup-ruby` on custom docker images, so we
# have to do our own caching
name: Cache gems
uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
-
name: Cache SPM
uses: actions/cache@v3
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
-
name: Bundle install
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
-
name: Run tests
run: bundle exec rake spm:test

macos:
name: Test SPM macOS
runs-on: macos-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
-
name: Cache SPM
uses: actions/cache@v3
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
-
name: Run tests
run: bundle exec rake spm:test
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

0 comments on commit 0bcf1ad

Please sign in to comment.