Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
subosito committed Aug 13, 2019
0 parents commit 3aa0d2f
Show file tree
Hide file tree
Showing 188 changed files with 19,613 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/workflow.yml
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!node_modules/
__tests__/runner/*
11 changes: 11 additions & 0 deletions .prettierrc.json
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"
}
21 changes: 21 additions & 0 deletions LICENSE
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.
17 changes: 17 additions & 0 deletions README.md
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
```
39 changes: 39 additions & 0 deletions __tests__/installer.test.ts
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);
});
14 changes: 14 additions & 0 deletions action.yml
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'
11 changes: 11 additions & 0 deletions jest.config.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
}
1 change: 1 addition & 0 deletions node_modules/.bin/semver

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/uuid

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/@actions/core/LICENSE.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

81 changes: 81 additions & 0 deletions node_modules/@actions/core/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions node_modules/@actions/core/lib/command.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions node_modules/@actions/core/lib/command.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/@actions/core/lib/command.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3aa0d2f

Please sign in to comment.