Skip to content

Commit 49f6f97

Browse files
committed
init to winit
0 parents  commit 49f6f97

File tree

15 files changed

+6666
-0
lines changed

15 files changed

+6666
-0
lines changed

.github/FUNDING.yml

Whitespace-only changes.

.github/workflows/main.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Main
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
# https://github.com/actions/checkout
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
- name: Install
13+
run: npm ci
14+
- name: Build
15+
run: npm run build
16+
- name: Test
17+
run: npm run test
18+
- name: Format
19+
run: npm run fmtcheck
20+
integration:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v2
25+
- name: Setup Fastly CLI
26+
uses: ./ # Uses an action in the root directory
27+
#env:
28+
# FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }}
29+
- name: Enjoy
30+
run: fastly whoami

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
__tests__/runner/*
2+
node_modules
3+
coverage

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
12.14.1

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 0.1.0
2+
3+
* initial release

LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2020 Doug Tangren
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Setup Fastly CLI
2+
3+
> ⏲️A GitHub Action for setting up and configuring the [Fastly command line interface](https://github.com/fastly/cli)
4+
5+
## usage
6+
7+
Create a [Fastly API token](https://manage.fastly.com/account/personal/tokens) and store it in your GitHub repository's actions secrets.
8+
9+
Then add a step to your workflow to install and configure the Fastly CLI
10+
11+
```yml
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
- name: Setup Fastly CLI
19+
uses: softprops/setup-fastly-cli@v1
20+
env:
21+
FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }}
22+
- name: Enjoy
23+
run: fastly whoami
24+
```
25+
26+
#### inputs
27+
28+
| Name | Type | Description |
29+
|-------------|---------|-----------------------------------------------------------------|
30+
| `version` | string | version of [Fastly cli release](https://github.com/fastly/cli/releases) defaults to latest version |
31+
32+
33+
#### env
34+
35+
| Name | Type | Description |
36+
|-------------|---------|-----------------------------------------------------------------|
37+
| `fastly-api-token` | string | personal [Fastly API token](https://manage.fastly.com/account/personal/tokens) |
38+
39+
40+
Doug Tangren (softprops) 2020

__tests__/main.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { fileName, downloadUrl } from "../src/main";
2+
import * as assert from "assert";
3+
4+
describe("main", () => {
5+
describe("fileName", () => {
6+
it("generates linux file names", () => {
7+
assert.equal(fileName("1.0", "linux"), "fastly_1.0_linux-amd64.tar.gz");
8+
});
9+
it("generates osx file names", () => {
10+
assert.equal(fileName("1.0", "darwin"), "fastly_1.0_darwin-amd64.tar.gz");
11+
});
12+
it("generates windows file names", () => {
13+
assert.equal(fileName("1.0", "win32"), "fastly_1.0_windows-amd64.zip");
14+
});
15+
});
16+
describe("downloadUrl", () => {
17+
it("generates urls for downloading cli", () => {
18+
assert.equal(
19+
downloadUrl("1.0", "linux"),
20+
"https://github.com/fastly/cli/releases/download/1.0/fastly_1.0_linux-amd64.tar.gz"
21+
);
22+
});
23+
});
24+
});

action.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# https://help.github.com/en/articles/metadata-syntax-for-github-actions
2+
name: 'Setup Fastly CLI'
3+
description: 'A GitHub Action for setting up and configuring the Fastly command line interface'
4+
author: 'softprops'
5+
env:
6+
'FASTLY_API_TOKEN': 'Fastly API token'
7+
runs:
8+
using: 'node12'
9+
main: 'dist/index.js'
10+
inputs:
11+
version:
12+
description: "Version of cli (defaults to latest version)"
13+
branding:
14+
color: 'red'
15+
icon: 'clock'

dist/index.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jest.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
clearMocks: true,
3+
moduleFileExtensions: ['js', 'ts'],
4+
testEnvironment: 'node',
5+
testMatch: ['**/*.test.ts'],
6+
testRunner: 'jest-circus/runner',
7+
transform: {
8+
'^.+\\.ts$': 'ts-jest'
9+
},
10+
verbose: true
11+
}

0 commit comments

Comments
 (0)