Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ ci ] Switch to an appropriate pack collection when on bleeding edge #2

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/workflows/ci-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
if [ "$CURR" == "$MAIN" ]; then
echo 'upstream-matrix=["latest-pack-collection"]'
else
echo 'upstream-matrix=["latest-pack-collection", "bleeding-edge-compiler"]'
echo 'upstream-matrix=["latest-pack-collection", "bleeding-edge"]'
fi >> "$GITHUB_OUTPUT"

build-and-test:
Expand All @@ -65,17 +65,18 @@ jobs:
uses: actions/checkout@v4
- name: Update `pack-db`
run: pack update-db
- name: Compute the package name and desired pack collection
run: |
{ echo "package_name=$(sed -e 's|.*/||' -e 's/idris2\?-//' <<< ${{ github.repository }})"
echo "pack_collection=${{ matrix.upstream-mode == 'bleeding-edge' && 'HEAD' || 'latest' }}"
} >> "$GITHUB_ENV"
- name: Switch to the latest compiler, if needed
if: ${{ matrix.upstream-mode == 'bleeding-edge-compiler' }}
if: ${{ matrix.upstream-mode == 'bleeding-edge' }}
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"
- name: Switch to the ${{ env.pack_collection }} collection
run: pack switch ${{ env.pack_collection }}
- name: Build `${{ env.package_name }}`
run: pack build ${{ env.package_name }}
- name: Test `${{ env.package_name }}`
Expand Down
Loading