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 bd64e28 commit 14efd41
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 6 deletions.
13 changes: 12 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ 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
Expand All @@ -19,11 +21,15 @@ indent_size = 2
indent_style = space
indent_size = 2

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

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

[{*.sh,buildhook}]
[{*.sh,run,*.bat}]
indent_style = space
indent_size = 2
shell_variant = posix
Expand All @@ -35,3 +41,8 @@ indent_style = tab

[expected]
trim_trailing_whitespace = false
max_line_length = off

[*.py]
indent_style = space
indent_size = 4
41 changes: 39 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,17 +30,52 @@ 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: ${{ fromJSON(needs.get-upstream-matrix.outputs.upstream-matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Update `pack-db`
run: pack update-db
- name: Switch to the latest compiler, if needed
if: ${{ matrix.upstream-mode == 'bleeding-edge-compiler' }}
run: |
{ echo; echo "[idris2]"; echo 'commit = "latest:main"'; } >> pack.toml
pack fetch
- 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 14efd41

Please sign in to comment.