Skip to content

Commit

Permalink
Merge branch 'dev' into releases/v3
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesIves committed Mar 7, 2020
2 parents 01f77e6 + 6a157b9 commit b52d6c9
Show file tree
Hide file tree
Showing 17 changed files with 1,788 additions and 691 deletions.
62 changes: 62 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"plugins": ["jest", "@typescript-eslint"],
"extends": ["plugin:github/es6"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module",
"project": "./tsconfig.json"
},
"globals": {
"fetch": true
},
"rules": {
"eslint-comments/no-use": "off",
"import/no-namespace": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-ignore": "error",
"camelcase": "off",
"@typescript-eslint/camelcase": "error",
"@typescript-eslint/class-name-casing": "error",
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
"@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/generic-type-naming": ["error", "^[A-Z][A-Za-z]*$"],
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-object-literal-type-assertion": "error",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-interface": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"semi": "off",
"@typescript-eslint/semi": ["error", "never"],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "error",
"no-console": "off"
},
"env": {
"node": true,
"es6": true,
"jest/globals": true
}
}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ yarn-error.log
*.pub

## CodeCov
coverage
coverage

# Yarn Integrity file
.yarn-integrity
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": false,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"arrowParens": "avoid",
"parser": "typescript"
}
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout 🛎️
uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false

- name: Build and Deploy
- name: Build and Deploy 🚀
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
Expand Down Expand Up @@ -56,7 +56,7 @@ import run, {
init,
deploy,
generateBranch,
actionInterface
ActionInterface
} from "github-pages-deploy-action";
```

Expand Down Expand Up @@ -134,7 +134,7 @@ With this configured you must add the `ssh-agent` step to your workflow and set
with:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}

- name: Build and Deploy
- name: Build and Deploy 🚀
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
SSH: true
Expand All @@ -155,7 +155,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout 🛎️
uses: actions/checkout@v2
with:
persist-credentials: false
Expand All @@ -165,12 +165,12 @@ jobs:
npm install
npm run-script build
- name: Install SSH Client
- name: Install SSH Client 🔑
uses: webfactory/ssh-agent@v0.2.0 # This step installs the ssh client into the workflow run. There's many options available for this on the action marketplace.
with:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}

- name: Build and Deploy Repo
- name: Build and Deploy Repo 🚀
uses: JamesIves/github-pages-deploy-action@releases/v3-test
with:
BASE_BRANCH: master
Expand Down Expand Up @@ -207,7 +207,7 @@ jobs:
build:
runs-on: windows-latest # The first job utilizes windows-latest
steps:
- name: Checkout
- name: Checkout 🛎️
uses: actions/checkout@v2
with:
persist-credentials: false
Expand All @@ -227,7 +227,7 @@ jobs:
needs: [build] # The second job must depend on the first one to complete before running, and uses ubuntu-latest instead of windows.
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout 🛎️
uses: actions/checkout@v2
with:
persist-credentials: false
Expand All @@ -237,7 +237,7 @@ jobs:
with:
name: site
- name: Build and Deploy
- name: Build and Deploy 🚀
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
Expand Down
42 changes: 21 additions & 21 deletions __tests__/execute.test.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
import { execute, stdout } from "../src/execute";
import { exec } from "@actions/exec";
import {execute, stdout} from '../src/execute'
import {exec} from '@actions/exec'

jest.mock("@actions/exec", () => ({
jest.mock('@actions/exec', () => ({
exec: jest.fn()
}));
}))

describe("execute", () => {
it("should be called with the correct arguments", async () => {
await stdout("hello");
await execute("echo Montezuma", "./");
describe('execute', () => {
it('should be called with the correct arguments', async () => {
await stdout('hello')
await execute('echo Montezuma', './')

expect(exec).toBeCalledWith("echo Montezuma", [], {
cwd: "./",
expect(exec).toBeCalledWith('echo Montezuma', [], {
cwd: './',
silent: true,
listeners: {
stdout: expect.any(Function)
}
});
});
})
})

it("should not silence the input when INPUT_DEBUG is defined", async () => {
process.env["DEBUG_DEPLOY_ACTION"] = "yes";
it('should not silence the input when INPUT_DEBUG is defined', async () => {
process.env['DEBUG_DEPLOY_ACTION'] = 'yes'

await stdout("hello");
await execute("echo Montezuma", "./");
await stdout('hello')
await execute('echo Montezuma', './')

expect(exec).toBeCalledWith("echo Montezuma", [], {
cwd: "./",
expect(exec).toBeCalledWith('echo Montezuma', [], {
cwd: './',
silent: false,
listeners: {
stdout: expect.any(Function)
}
});
});
});
})
})
})
Loading

0 comments on commit b52d6c9

Please sign in to comment.