Skip to content

Commit a3c9bd0

Browse files
committed
Merge branch 'release/2.0.0' into main
2 parents cca250b + c1479a9 commit a3c9bd0

18 files changed

+7477
-48
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/** -diff linguist-generated=true

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
# Enable version updates for npm
4+
- package-ecosystem: "npm"
5+
# Look for `package.json` and `lock` files in the `root` directory
6+
directory: "/"
7+
# Check the npm registry for updates every day (weekdays)
8+
schedule:
9+
interval: "daily"
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
name: Test
1+
name: "Tests"
22
on:
33
push:
4-
paths-ignore:
5-
- '**.md'
4+
paths:
5+
- '.github/workflows/tests.yml'
6+
- 'action.yml'
7+
- 'dist/**'
68
pull_request:
7-
paths-ignore:
8-
- '**.md'
9+
paths:
10+
- '.github/workflows/tests.yml'
11+
- 'action.yml'
12+
- 'dist/**'
913

1014
jobs:
15+
# test action works running from the graph
1116
test:
12-
name: Test
1317
runs-on: ${{ matrix.operating-system }}
1418
strategy:
1519
matrix:
@@ -21,11 +25,8 @@ jobs:
2125
- operating-system: "ubuntu-20.04"
2226
swift-version: "5.1.5"
2327
steps:
24-
- name: Checkout
25-
uses: actions/checkout@v2
26-
- name: actions-setup-swift
27-
uses: ./
28+
- uses: actions/checkout@v2
29+
- uses: ./
2830
with:
2931
swift-version: ${{ matrix.swift-version }}
30-
- name: Swift Version
31-
run: swift -v
32+
- run: swift -version

.github/workflows/units.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: "Unit Tests"
2+
on:
3+
push:
4+
paths:
5+
- '.github/workflows/units.yml'
6+
- '**/*.js'
7+
- '**/*.mjs'
8+
pull_request:
9+
paths:
10+
- '.github/workflows/units.yml'
11+
- '**/*.js'
12+
- '**/*.mjs'
13+
14+
jobs:
15+
# unit tests
16+
units:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
- run: npm ci
21+
- run: npm test

.gitignore

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
node_modules/
2+
3+
# Editors
4+
.vscode/
5+
.idea/
6+
*.iml
7+
8+
# Logs
9+
logs
10+
*.log
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
15+
# Runtime data
16+
pids
17+
*.pid
18+
*.seed
19+
*.pid.lock
20+
21+
# Directory for instrumented libs generated by jscoverage/JSCover
22+
lib-cov
23+
24+
# Coverage directory used by tools like istanbul
25+
coverage
26+
27+
# nyc test coverage
28+
.nyc_output
29+
30+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
31+
.grunt
32+
33+
# Bower dependency directory (https://bower.io/)
34+
bower_components
35+
36+
# node-waf configuration
37+
.lock-wscript
38+
39+
# Compiled binary addons (https://nodejs.org/api/addons.html)
40+
build/Release
41+
42+
# Other Dependency directories
43+
jspm_packages/
44+
45+
# TypeScript v1 declaration files
46+
typings/
47+
48+
# Optional npm cache directory
49+
.npm
50+
51+
# Optional eslint cache
52+
.eslintcache
53+
54+
# Optional REPL history
55+
.node_repl_history
56+
57+
# Output of 'npm pack'
58+
*.tgz
59+
60+
# Yarn Integrity file
61+
.yarn-integrity
62+
63+
# dotenv environment variables file
64+
.env
65+
66+
# next.js build output
67+
.next

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @actions/actions-runtime

CONTRIBUTING.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Contributing
2+
3+
## Install the dependencies
4+
5+
```bash
6+
npm install
7+
```
8+
9+
## Run the tests :heavy_check_mark:
10+
11+
```bash
12+
$ npm test
13+
14+
PASS ./index.test.js
15+
✓ throws invalid number (3ms)
16+
wait 500 ms (504ms)
17+
test runs (95ms)
18+
...
19+
```
20+
21+
## Package for distribution
22+
23+
Run prepare
24+
25+
```bash
26+
npm run prepare
27+
```

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
[![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)
44

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

78
- optionally downloading a version of swift from swift.org.
9+
- supports macOS, Linux runner.
810

911
# Usage
1012

@@ -14,7 +16,7 @@ Basic:
1416
```yaml
1517
steps:
1618
- uses: actions/checkout@v2
17-
- uses: sinoru/actions-setup-swift@v1
19+
- uses: sinoru/actions-setup-swift@v2
1820
with:
1921
swift-version: '5.3.3' # Exact version of a Swift version to use
2022
- run: swift build -v

action.yml

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,7 @@ branding:
66
inputs:
77
swift-version:
88
description: 'Exact version of a Swift version to use.'
9-
required: true
9+
required: false
1010
runs:
11-
using: 'composite'
12-
steps:
13-
- name: Install Essentials
14-
shell: bash
15-
run: |
16-
echo "::group::Install Essentials"
17-
18-
case "${{ runner.os }}" in
19-
"Linux") sudo apt-get install build-essential binutils gnupg2 libedit2 libpython2.7 libsqlite3-0 libxml2 libz3-dev tzdata zlib1g-dev;;
20-
esac
21-
22-
echo "::endgroup::"
23-
- name: Install swiftlint
24-
shell: bash
25-
run: |
26-
echo "::group::Install swiftlint"
27-
28-
export SWIFTENV_ROOT="${{ github.action_path }}/swiftenv"
29-
export PATH="$SWIFTENV_ROOT/bin:$SWIFTENV_ROOT/shims:$PATH"
30-
31-
git clone --depth 1 https://github.com/kylef/swiftenv.git $SWIFTENV_ROOT
32-
33-
echo "SWIFTENV_ROOT=$SWIFTENV_ROOT" >> $GITHUB_ENV
34-
echo "$SWIFTENV_ROOT/bin:$SWIFTENV_ROOT/shims" >> $GITHUB_PATH
35-
36-
echo "::endgroup::"
37-
- name: Install swift
38-
shell: bash
39-
run: |
40-
echo "::group::Install swift"
41-
42-
swiftenv install -s ${{ inputs.swift-version }}
43-
44-
echo "::endgroup::"
11+
using: 'node12'
12+
main: 'dist/index.js'

0 commit comments

Comments
 (0)