Skip to content

Commit

Permalink
Merge branch 'release/2.0.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
sinoru committed Mar 2, 2021
2 parents cca250b + c1479a9 commit a3c9bd0
Show file tree
Hide file tree
Showing 18 changed files with 7,477 additions and 48 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/** -diff linguist-generated=true
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
# Enable version updates for npm
- package-ecosystem: "npm"
# Look for `package.json` and `lock` files in the `root` directory
directory: "/"
# Check the npm registry for updates every day (weekdays)
schedule:
interval: "daily"
25 changes: 13 additions & 12 deletions .github/workflows/test.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
name: Test
name: "Tests"
on:
push:
paths-ignore:
- '**.md'
paths:
- '.github/workflows/tests.yml'
- 'action.yml'
- 'dist/**'
pull_request:
paths-ignore:
- '**.md'
paths:
- '.github/workflows/tests.yml'
- 'action.yml'
- 'dist/**'

jobs:
# test action works running from the graph
test:
name: Test
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
Expand All @@ -21,11 +25,8 @@ jobs:
- operating-system: "ubuntu-20.04"
swift-version: "5.1.5"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: actions-setup-swift
uses: ./
- uses: actions/checkout@v2
- uses: ./
with:
swift-version: ${{ matrix.swift-version }}
- name: Swift Version
run: swift -v
- run: swift -version
21 changes: 21 additions & 0 deletions .github/workflows/units.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Unit Tests"
on:
push:
paths:
- '.github/workflows/units.yml'
- '**/*.js'
- '**/*.mjs'
pull_request:
paths:
- '.github/workflows/units.yml'
- '**/*.js'
- '**/*.mjs'

jobs:
# unit tests
units:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm ci
- run: npm test
67 changes: 67 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
node_modules/

# Editors
.vscode/
.idea/
*.iml

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Other Dependency directories
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @actions/actions-runtime
27 changes: 27 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Contributing

## Install the dependencies

```bash
npm install
```

## Run the tests :heavy_check_mark:

```bash
$ npm test

PASS ./index.test.js
✓ throws invalid number (3ms)
wait 500 ms (504ms)
test runs (95ms)
...
```

## Package for distribution

Run prepare

```bash
npm run prepare
```
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
[![Test](https://github.com/sinoru/actions-setup-swift/actions/workflows/test.yml/badge.svg)](https://github.com/sinoru/actions-setup-swift/actions/workflows/test.yml)

This action sets up a swift environment for use in actions by:
This action sets up a swift environment using [swiftenv](https://github.com/kylef/swiftenv) for use in actions by:

- optionally downloading a version of swift from swift.org.
- supports macOS, Linux runner.

# Usage

Expand All @@ -14,7 +16,7 @@ Basic:
```yaml
steps:
- uses: actions/checkout@v2
- uses: sinoru/actions-setup-swift@v1
- uses: sinoru/actions-setup-swift@v2
with:
swift-version: '5.3.3' # Exact version of a Swift version to use
- run: swift build -v
Expand Down
38 changes: 3 additions & 35 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,7 @@ branding:
inputs:
swift-version:
description: 'Exact version of a Swift version to use.'
required: true
required: false
runs:
using: 'composite'
steps:
- name: Install Essentials
shell: bash
run: |
echo "::group::Install Essentials"
case "${{ runner.os }}" in
"Linux") sudo apt-get install build-essential binutils gnupg2 libedit2 libpython2.7 libsqlite3-0 libxml2 libz3-dev tzdata zlib1g-dev;;
esac
echo "::endgroup::"
- name: Install swiftlint
shell: bash
run: |
echo "::group::Install swiftlint"
export SWIFTENV_ROOT="${{ github.action_path }}/swiftenv"
export PATH="$SWIFTENV_ROOT/bin:$SWIFTENV_ROOT/shims:$PATH"
git clone --depth 1 https://github.com/kylef/swiftenv.git $SWIFTENV_ROOT
echo "SWIFTENV_ROOT=$SWIFTENV_ROOT" >> $GITHUB_ENV
echo "$SWIFTENV_ROOT/bin:$SWIFTENV_ROOT/shims" >> $GITHUB_PATH
echo "::endgroup::"
- name: Install swift
shell: bash
run: |
echo "::group::Install swift"
swiftenv install -s ${{ inputs.swift-version }}
echo "::endgroup::"
using: 'node12'
main: 'dist/index.js'
Loading

0 comments on commit a3c9bd0

Please sign in to comment.