Skip to content

Commit

Permalink
[ ci ] Update and optimise CI configs, bump versions
Browse files Browse the repository at this point in the history
  • Loading branch information
buzden committed Feb 6, 2024
1 parent 636289e commit a631cfe
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 5 deletions.
48 changes: 48 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# top-most EditorConfig file
root = true

# Defaults for every file
[*]
end_of_line = lf
charset = utf-8

insert_final_newline = true
trim_trailing_whitespace = true

max_line_length = 152

# 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

[*.{c,h}]
indent_style = space
indent_size = 4

[*.{md,rst}]
indent_style = space
indent_size = 2

[{*.sh,run,*.bat}]
indent_style = space
indent_size = 2
shell_variant = posix
switch_case_indent = true
space_redirects = true

[{Makefile,*.mk}]
indent_style = tab

[expected]
trim_trailing_whitespace = false
max_line_length = off

[*.py]
indent_style = space
indent_size = 4
30 changes: 28 additions & 2 deletions .github/workflows/ci-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ on:
schedule:
- cron: '0 1 * * *'

permissions: read-all

concurrency:
group: ${{ github.workflow }}@${{ github.ref }}
cancel-in-progress: true
Expand All @@ -28,14 +30,36 @@ env:

jobs:

get-upstream-matrix:
name: Acquire matrix of upstream modes
runs-on: ubuntu-latest
container: ghcr.io/stefan-hoeck/idris2-pack:latest
outputs:
upstream-matrix: "${{ steps.get-upstream-matrix.outputs.upstream-matrix }}"
steps:
- name: Install Git
run: apt-get update && apt-get install git
- name: Get upstream matrix
id: get-upstream-matrix
run: |
CURR="$(idris2 --version | sed 's/.*-//')"
MAIN="$(git ls-remote https://github.com/idris-lang/Idris2 main | head -c 9)"
echo "Current: $CURR, bleeding edge: $MAIN"
if [ "$CURR" == "$MAIN" ]; then
echo 'upstream-matrix=["latest-pack-collection"]'
else
echo 'upstream-matrix=["latest-pack-collection", "bleeding-edge-compiler"]'
fi >> "$GITHUB_OUTPUT"
build-and-test:
name: Build and test `${{ github.repository }}`
needs: get-upstream-matrix
runs-on: ubuntu-latest
container: ghcr.io/stefan-hoeck/idris2-pack:latest
strategy:
fail-fast: false
matrix:
upstream-mode: [latest-pack-collection, bleeding-edge-compiler]
upstream-mode: ${{ fromJSON(needs.get-upstream-matrix.outputs.upstream-matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -49,7 +73,9 @@ jobs:
- name: Switch to the latest collection
run: pack switch latest
- name: Compute the package name
run: echo "package_name=$(sed -e 's|.*/||' -e 's/idris2\?-//' <<< ${{ github.repository }})" >> "$GITHUB_ENV"
run: |
echo "package_name=$(sed -e 's|.*/||' -e 's/idris2\?-//' \
<<< ${{ github.repository }})" >> "$GITHUB_ENV"
- name: Build `${{ env.package_name }}`
run: pack build ${{ env.package_name }}
- name: Test `${{ env.package_name }}`
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/ci-super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
- main
- master

permissions:
statuses: write

concurrency:
group: ${{ github.workflow }}@${{ github.ref }}
cancel-in-progress: true
Expand All @@ -24,16 +27,15 @@ jobs:
steps:

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
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
uses: super-linter/super-linter/slim@v6.0.0
env:
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IGNORE_GENERATED_FILES: true
VALIDATE_JSCPD_ALL_CODEBASE: true

0 comments on commit a631cfe

Please sign in to comment.