From 245241bfcb032ee2609f6d816484e49db86be294 Mon Sep 17 00:00:00 2001 From: stefan-hoeck Date: Mon, 30 Jan 2023 13:59:48 +0000 Subject: [PATCH] [ CI ] setup CI --- .editorconfig | 51 +++++++++++++++++++++++++++ .github/linters/.ecrc | 5 +++ .github/workflows/ci-lib.yml | 32 +++++++++++++++++ .github/workflows/ci-super-linter.yml | 32 +++++++++++++++++ 4 files changed, 120 insertions(+) create mode 100644 .editorconfig create mode 100644 .github/linters/.ecrc create mode 100644 .github/workflows/ci-lib.yml create mode 100644 .github/workflows/ci-super-linter.yml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..df97ed6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,51 @@ +# top-most EditorConfig file +root = true + +# Defaults for every file +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +charset = utf-8 + +# Idris source files +[*.{idr,ipkg,tex,yaff,lidr}] +indent_style = space +indent_size = 2 + +# Various configuration files +[{*.yml,.ecrc}] +indent_style = space +indent_size = 2 + +[*.py] +indent_style = space +indent_size = 4 + +[*.{c,h}] +indent_style = space +indent_size = 4 + +[*.{md,rst}] +indent_style = space +indent_size = 2 + +[*.sh] +indent_style = space +indent_size = 4 +shell_variant = posix +switch_case_indent = true + +[*.bat] +indent_style = space +indent_size = 4 + +[{Makefile,*.mk}] +indent_style = tab + +[*.nix] +indent_style = space +indent_size = 2 + +[expected] +trim_trailing_whitespace = false diff --git a/.github/linters/.ecrc b/.github/linters/.ecrc new file mode 100644 index 0000000..b682057 --- /dev/null +++ b/.github/linters/.ecrc @@ -0,0 +1,5 @@ +{ + "Disable": { + "IndentSize": true + } +} diff --git a/.github/workflows/ci-lib.yml b/.github/workflows/ci-lib.yml new file mode 100644 index 0000000..d70a349 --- /dev/null +++ b/.github/workflows/ci-lib.yml @@ -0,0 +1,32 @@ +--- +name: Build + +on: + push: + branches: + - '**' + tags: + - '**' + pull_request: + branches: + - main + +defaults: + run: + shell: bash + +jobs: + + build: + name: Build the lib with Idris2 HEAD + runs-on: ubuntu-latest + env: + PACK_DIR: /root/.pack + strategy: + fail-fast: false + container: ghcr.io/stefan-hoeck/idris2-pack:latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Build getopts + run: pack typecheck getopts diff --git a/.github/workflows/ci-super-linter.yml b/.github/workflows/ci-super-linter.yml new file mode 100644 index 0000000..b3af911 --- /dev/null +++ b/.github/workflows/ci-super-linter.yml @@ -0,0 +1,32 @@ +name: Lint + +on: + push: + branches: + - '*' + tags: + - '*' + pull_request: + branches: + - main + - master + +jobs: + build: + name: Lint Code Base + runs-on: ubuntu-latest + steps: + + - name: Checkout + uses: actions/checkout@v2 + with: + # Full git history is needed to get a proper list of changed files within `super-linter` + fetch-depth: 0 + + - name: Lint Code Base + uses: github/super-linter/slim@v4 + env: + VALIDATE_ALL_CODEBASE: false + DEFAULT_BRANCH: main + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + IGNORE_GENERATED_FILES: true