-
-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Main workflow | ||
on: [push] | ||
jobs: | ||
run: | ||
name: Run | ||
runs-on: ${{ matrix.operating-system }} | ||
strategy: | ||
matrix: | ||
operating-system: [ubuntu-latest, windows-latest, macos-latest] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
|
||
- name: Set Node.js 10.x | ||
uses: actions/setup-node@master | ||
with: | ||
version: 10.x | ||
|
||
- name: npm install | ||
run: npm install | ||
|
||
- name: Lint | ||
run: npm run format-check | ||
|
||
- name: npm test | ||
run: npm test |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
!node_modules/ | ||
__tests__/runner/* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"printWidth": 80, | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"semi": true, | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"bracketSpacing": false, | ||
"arrowParens": "avoid", | ||
"parser": "typescript" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2019 Alif Rachmawadi <arch@subosito.com> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# flutter-action | ||
|
||
This action sets up a flutter environment for use in actions. | ||
|
||
# Usage | ||
|
||
```yaml | ||
steps: | ||
- uses: actions/checkout@latest | ||
- uses: actions/setup-java@v1 | ||
with: | ||
version: '8.x' | ||
- uses: subosito/flutter-action@master | ||
with: | ||
version: 'v1.7.8+hotfix.4' | ||
- run: flutter build apk | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import io = require('@actions/io'); | ||
import fs = require('fs'); | ||
import path = require('path'); | ||
|
||
const toolDir = path.join(__dirname, 'runner', 'tools'); | ||
|
||
process.env['RUNNER_TOOL_CACHE'] = toolDir; | ||
|
||
import * as installer from '../src/installer'; | ||
|
||
describe('installer tests', () => { | ||
beforeAll(async () => { | ||
await io.rmRF(toolDir); | ||
}, 300000); | ||
|
||
afterAll(async () => { | ||
try { | ||
await io.rmRF(toolDir); | ||
} catch { | ||
console.log('Failed to remove test directories'); | ||
} | ||
}, 100000); | ||
|
||
it('Downloads flutter', async () => { | ||
await installer.getFlutter('v1.7.8+hotfix.4', 'stable'); | ||
const sdkDir = path.join(toolDir, 'Flutter', 'v1.7.8+hotfix.4-stable'); | ||
|
||
expect(fs.existsSync(`${sdkDir}.complete`)).toBe(true); | ||
expect(fs.existsSync(path.join(sdkDir, 'bin'))).toBe(true); | ||
}, 100000); | ||
|
||
it('Downloads flutter from beta channel', async () => { | ||
await installer.getFlutter('v1.8.3', 'beta'); | ||
const sdkDir = path.join(toolDir, 'Flutter', 'v1.8.3-beta'); | ||
|
||
expect(fs.existsSync(`${sdkDir}.complete`)).toBe(true); | ||
expect(fs.existsSync(path.join(sdkDir, 'bin'))).toBe(true); | ||
}, 100000); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: 'Setup Flutter environment' | ||
description: 'Setup your runner with Flutter' | ||
author: 'Alif Rachmawadi' | ||
inputs: | ||
version: | ||
description: 'The Flutter version to make available on the path' | ||
required: true | ||
channel: | ||
description: 'The Flutter build release channel' | ||
required: false | ||
default: 'stable' | ||
runs: | ||
using: 'node12' | ||
main: 'lib/index.js' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
clearMocks: true, | ||
moduleFileExtensions: ['js', 'ts'], | ||
testEnvironment: 'node', | ||
testMatch: ['**/*.test.ts'], | ||
testRunner: 'jest-circus/runner', | ||
transform: { | ||
'^.+\\.ts$': 'ts-jest' | ||
}, | ||
verbose: true | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.