forked from actions/checkout
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert checkout to a regular action (actions#70)
- Loading branch information
1 parent
50fbc62
commit e347bba
Showing
33 changed files
with
22,253 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dist/ | ||
lib/ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
"plugins": ["jest", "@typescript-eslint"], | ||
"extends": ["plugin:github/es6"], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 9, | ||
"sourceType": "module", | ||
"project": "./tsconfig.json" | ||
}, | ||
"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": "error", | ||
"@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" | ||
}, | ||
"env": { | ||
"node": true, | ||
"es6": true, | ||
"jest/globals": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,83 @@ | ||
name: "test-local" | ||
name: Build and Test | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
- 'releases/*' | ||
- releases/* | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 # todo: switch to v2 | ||
- run: npm ci | ||
- run: npm run build | ||
- run: npm run format-check | ||
- run: npm run lint | ||
- run: npm run pack | ||
- run: npm run gendocs | ||
- name: Verify no unstaged changes | ||
run: __test__/verify-no-unstaged-changes.sh | ||
|
||
test: | ||
strategy: | ||
matrix: | ||
os: [windows-latest, ubuntu-latest, macOS-latest] | ||
runs-on: ${{ matrix.os }} | ||
runs-on: [ubuntu-latest, macos-latest, windows-latest] | ||
runs-on: ${{ matrix.runs-on }} | ||
|
||
steps: | ||
- uses: actions/checkout@master | ||
- uses: ./ | ||
with: | ||
ref: master | ||
# Clone this repo | ||
- name: Checkout | ||
uses: actions/checkout@v1 # todo: switch to V2 | ||
|
||
# Basic checkout | ||
- name: Basic checkout | ||
uses: ./ | ||
with: | ||
ref: test-data/v2/basic | ||
path: basic | ||
- name: Verify basic | ||
shell: bash | ||
run: __test__/verify-basic.sh | ||
|
||
# Clean | ||
- name: Modify work tree | ||
shell: bash | ||
run: __test__/modify-work-tree.sh | ||
- name: Clean checkout | ||
uses: ./ | ||
with: | ||
ref: test-data/v2/basic | ||
path: basic | ||
- name: Verify clean | ||
shell: bash | ||
run: __test__/verify-clean.sh | ||
|
||
# Side by side | ||
- name: Side by side checkout 1 | ||
uses: ./ | ||
with: | ||
ref: test-data/v2/side-by-side-1 | ||
path: side-by-side-1 | ||
- name: Side by side checkout 2 | ||
uses: ./ | ||
with: | ||
ref: test-data/v2/side-by-side-2 | ||
path: side-by-side-2 | ||
- name: Verify side by side | ||
shell: bash | ||
run: __test__/verify-side-by-side.sh | ||
|
||
# LFS | ||
- name: LFS checkout | ||
uses: ./ | ||
with: | ||
repository: actions/checkout # hardcoded, otherwise doesn't work from a fork | ||
ref: test-data/v2/lfs | ||
path: lfs | ||
lfs: true | ||
- name: Verify LFS | ||
shell: bash | ||
run: __test__/verify-lfs.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
lib/ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dist/ | ||
lib/ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
# Changelog | ||
|
||
## Unreleased Changes | ||
- N/A | ||
## v2 (preview) | ||
|
||
## v1.2.0 | ||
- Reverted the breaking behavior change in v1.1.0 that broke custom authentication flows | ||
- Improved fetch performance | ||
- The default behavior now fetches only the SHA being checked-out. | ||
- Script authenticated git commands | ||
- Persists `with.token` in the local git config. | ||
- Enables your scripts to run authenticated git commands. | ||
- Post-job cleanup removes the token. | ||
- Coming soon: Opt out by setting `with.persist-credentials` to `false`. | ||
- Creates a local branch | ||
- No longer detached HEAD when checking out a branch. | ||
- A local branch is created with the corresponding upstream branch set. | ||
- Improved layout | ||
- `with.path` is always relative to `github.workspace`. | ||
- Aligns better with container actions, where `github.workspace` gets mapped in. | ||
- Removed input `submodules` | ||
|
||
## v1.1.0 (Not reccomended for use, this functionality will be ported to the 2.0 update) | ||
- Persist `with.token` or `${{ github.token }}` into checkout repository's git config as `http.https://github.com/.extraheader=AUTHORIZATION: basic ***` to better support scripting git | ||
|
||
## v1.0.0 | ||
- Initial Release of the checkout action | ||
## v1 | ||
|
||
Refer [here](https://github.com/actions/checkout/blob/v1/CHANGELOG.md) for the V1 changelog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import {GitVersion} from '../lib/git-version' | ||
|
||
describe('git-version tests', () => { | ||
it('basics', async () => { | ||
let version = new GitVersion('') | ||
expect(version.isValid()).toBeFalsy() | ||
|
||
version = new GitVersion('asdf') | ||
expect(version.isValid()).toBeFalsy() | ||
|
||
version = new GitVersion('1.2') | ||
expect(version.isValid()).toBeTruthy() | ||
expect(version.toString()).toBe('1.2') | ||
|
||
version = new GitVersion('1.2.3') | ||
expect(version.isValid()).toBeTruthy() | ||
expect(version.toString()).toBe('1.2.3') | ||
}) | ||
|
||
it('check minimum', async () => { | ||
let version = new GitVersion('4.5') | ||
expect(version.checkMinimum(new GitVersion('3.6'))).toBeTruthy() | ||
expect(version.checkMinimum(new GitVersion('3.6.7'))).toBeTruthy() | ||
expect(version.checkMinimum(new GitVersion('4.4'))).toBeTruthy() | ||
expect(version.checkMinimum(new GitVersion('4.5'))).toBeTruthy() | ||
expect(version.checkMinimum(new GitVersion('4.5.0'))).toBeTruthy() | ||
expect(version.checkMinimum(new GitVersion('4.6'))).toBeFalsy() | ||
expect(version.checkMinimum(new GitVersion('4.6.0'))).toBeFalsy() | ||
expect(version.checkMinimum(new GitVersion('5.1'))).toBeFalsy() | ||
expect(version.checkMinimum(new GitVersion('5.1.2'))).toBeFalsy() | ||
|
||
version = new GitVersion('4.5.6') | ||
expect(version.checkMinimum(new GitVersion('3.6'))).toBeTruthy() | ||
expect(version.checkMinimum(new GitVersion('3.6.7'))).toBeTruthy() | ||
expect(version.checkMinimum(new GitVersion('4.4'))).toBeTruthy() | ||
expect(version.checkMinimum(new GitVersion('4.5'))).toBeTruthy() | ||
expect(version.checkMinimum(new GitVersion('4.5.5'))).toBeTruthy() | ||
expect(version.checkMinimum(new GitVersion('4.5.6'))).toBeTruthy() | ||
expect(version.checkMinimum(new GitVersion('4.5.7'))).toBeFalsy() | ||
expect(version.checkMinimum(new GitVersion('4.6'))).toBeFalsy() | ||
expect(version.checkMinimum(new GitVersion('4.6.0'))).toBeFalsy() | ||
expect(version.checkMinimum(new GitVersion('5.1'))).toBeFalsy() | ||
expect(version.checkMinimum(new GitVersion('5.1.2'))).toBeFalsy() | ||
}) | ||
}) |
Oops, something went wrong.