Skip to content

Commit

Permalink
[ ci ] Correct and optimise CI configs
Browse files Browse the repository at this point in the history
  • Loading branch information
buzden committed Feb 6, 2024
1 parent b342ae0 commit 3a43754
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/ci-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,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 Down
3 changes: 2 additions & 1 deletion .github/workflows/ci-super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ on:
- main
- master

permissions: read-all
permissions:
statuses: write

concurrency:
group: ${{ github.workflow }}@${{ github.ref }}
Expand Down

0 comments on commit 3a43754

Please sign in to comment.