Unverified Commit e347bba9 authored by eric sciple's avatar eric sciple Committed by GitHub
Browse files

Convert checkout to a regular action (#70)

parent 50fbc622
Loading
Loading
Loading
Loading
+3
Changes for .eslintignore: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
dist/
lib/
node_modules/
+58
Changes for .eslintrc.json: 58 added lines, 0 removed lines.
Original line number Diff line number Diff line
{
  "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
  }
}
+71 −7
Changes for .github/workflows/test.yml: 71 added lines, 7 removed lines.
Original line number Diff line number Diff line
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: ./
      # 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:
        ref: master
          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
+2
Changes for .gitignore: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
lib/
node_modules/
 No newline at end of file
+3
Changes for .prettierignore: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
dist/
lib/
node_modules/
 No newline at end of file
Loading