Skip to content

Update main.yml #204

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

Merged
merged 39 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
09cd898
Update main.yml
angerman Feb 5, 2025
fc1c309
Update main.yml
angerman Feb 5, 2025
f33619b
Update build-and-test.yml
angerman Feb 5, 2025
c24b962
Update main.yml
angerman Feb 5, 2025
5deb3ff
Update main.yml
angerman Feb 5, 2025
099f638
Update main.yml
angerman Feb 5, 2025
968fdb5
Update main.yml
angerman Feb 5, 2025
f5d8070
Update main.yml
angerman Feb 5, 2025
f4b1c34
Update main.yml
angerman Feb 5, 2025
360dcf2
Update main.yml
angerman Feb 5, 2025
e3f4586
Update main.yml
angerman Feb 5, 2025
850cbb8
Update main.yml
angerman Feb 5, 2025
b698152
Update main.yml
angerman Feb 5, 2025
1f750f6
Update main.yml
angerman Feb 5, 2025
b0db2a5
Update main.yml
angerman Feb 5, 2025
f9feb05
Update main.yml
angerman Feb 5, 2025
9c1c101
Update main.yml
angerman Feb 5, 2025
f59140e
Create container-upload.yml
angerman Feb 5, 2025
615bf64
Update main.yml
angerman Feb 5, 2025
39b50d7
Update main.yml
angerman Feb 5, 2025
d811834
Update main.yml
angerman Feb 5, 2025
c469bcb
Update main.yml
angerman Feb 5, 2025
30604db
Update main.yml
angerman Feb 5, 2025
c94e0e1
Update main.yml
angerman Feb 5, 2025
46861e1
Update main.yml
angerman Feb 5, 2025
f8f5345
Update main.yml
angerman Feb 5, 2025
00d75d8
Update main.yml
angerman Feb 5, 2025
b1efcc5
Update container-upload.yml
angerman Feb 5, 2025
c0de8e2
Lets try this appraoch
angerman Feb 5, 2025
a8fcc85
Add checkout phase
angerman Feb 5, 2025
bf0cb59
Meh
angerman Feb 5, 2025
8d17c71
.
angerman Feb 5, 2025
2f5a988
Add other platforms; fix label
angerman Feb 5, 2025
0ad700f
Cleanup
angerman Feb 5, 2025
dd61756
More cleanup
angerman Feb 5, 2025
cf4b8cd
Merge branch 'main' into angerman-patch-8
angerman Feb 5, 2025
0004af6
Drop container-upload
angerman Feb 6, 2025
434fb81
Bring tests back
angerman Feb 6, 2025
09b36dc
retry is the solution :facepalm:
angerman Feb 6, 2025
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
11 changes: 11 additions & 0 deletions .github/workflows/aarch64-darwin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: DevX closures for aarch64-darwin

on:
push:

jobs:
build:
name: Prebuild and Upload
uses: ./.github/workflows/main.yml
with:
platform: aarch64-darwin
11 changes: 11 additions & 0 deletions .github/workflows/aarch64-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: DevX closures for aarch64-linux

on:
push:

jobs:
build:
name: Prebuild and Upload
uses: ./.github/workflows/main.yml
with:
platform: aarch64-linux
1 change: 1 addition & 0 deletions .github/workflows/hello.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Test that we can build the hello world example form hackage

on:
push:
workflow_dispatch:
Expand Down
48 changes: 15 additions & 33 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Prebuild DevX closures
on:
push:
branches:
- main

workflow_dispatch:
on:
workflow_call:
inputs:
platform:
required: true
type: string

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -36,49 +37,28 @@ jobs:
# Group the output by platform.
RUNS=$(gh api "repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/check-runs" --paginate)
echo "checks..."
FILTERED=$(jq -c -r '.check_runs[] | select(.name | endswith("-env")) | { "config": .name, "build_path": .output.text }' <<< "$RUNS")
echo "filtered..."
MATRIX=$(jq --slurp -c -r '. as $jobs | map(.config | split(".") | first) | unique | map(. as $group | {"platform": $group, "jobs": $jobs | map(select(.config |startswith($group)))})' <<< "$FILTERED")
echo "groups..."
if jq -e . <<< "$MATRIX" > /dev/null 2>&1; then # JSON validation
echo "Valid JSON"
else
echo "Invalid JSON: $MATRIX"
exit 1 # or handle the error appropriately
fi
FILTERED=$(jq -c -r '.check_runs[] | select(.name | endswith("-env")) | select(.name | startswith("${{ inputs.platform }}")) | { "config": .name, "build_path": .output.text, "short_name": .name | sub("${{ inputs.platform }}\\.";"") }' <<< "$RUNS")
jq . <<< "$FILTERED"
MATRIX=$(jq --slurp -c -r '.' <<< "$FILTERED")
jq . <<< "$MATRIX"
echo "creating result matrix."
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT

# We need this process step in here, because we have in excess of 256 jobs.
process:
needs: discover
runs-on: ubuntu-latest # You still need runs-on to define a job, but it can be minimal
strategy:
fail-fast: false
matrix:
group: ${{ fromJson(needs.discover.outputs.matrix) }}
name: Process Jobs for ${{ matrix.group.platform }}
outputs:
jobs: ${{ toJson(matrix.group.jobs) }} # Direct output definition
steps:
- name: No-op step (required to have at least one step)
run: echo "No-op" # Minimal step to satisfy step requirement

ghcr-upload:
needs: process
name: Container Upload
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
job: ${{ fromJson(needs.process.outputs.matrix) }}
runs-on: ubuntu-latest
job: ${{ fromJson(needs.discover.outputs.matrix) }}
name: GHCR Upload for ${{ matrix.job.short_name }}
permissions:
contents: read
packages: write
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main

- name: Install Nix with good defaults
uses: cachix/install-nix-action@v20
with:
Expand All @@ -101,6 +81,8 @@ jobs:
NIX_STORE_SECRET_KEY: ${{ secrets.SECRET_KEY }}
run: ./extra/ghcr-upload.sh



# codespace-upload:
# env:
# IMAGE_NAME: input-output-hk/devx-devcontainer
Expand Down
147 changes: 0 additions & 147 deletions .github/workflows/wait-and-upload.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .github/workflows/x86_64-darwin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: DevX closures for x86_64-darwin

on:
push:

jobs:
build:
name: Prebuild and Upload
uses: ./.github/workflows/main.yml
with:
platform: x86_64-darwin
11 changes: 11 additions & 0 deletions .github/workflows/x86_64-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: DevX closures for x86_64-linux

on:
push:

jobs:
build:
name: Prebuild and Upload
uses: ./.github/workflows/main.yml
with:
platform: x86_64-linux
3 changes: 2 additions & 1 deletion extra/ghcr-upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ set -euox pipefail
: "${DEV_SHELL:?'DEV_SHELL is not set'}"
: "${SHELL_NIX_PATH:?'SHELL_NIX_PATH is not set'}"

nix-store -r "$SHELL_NIX_PATH"
# retry three times in case of intermittent network errors.
nix-store -r "$SHELL_NIX_PATH" || nix-store -r "$SHELL_NIX_PATH" || nix-store -r "$SHELL_NIX_PATH"
#nix build ".#hydraJobs.${DEV_SHELL}" --show-trace --accept-flake-config
nix-store --export $(nix-store -qR "$SHELL_NIX_PATH") | tee store-paths.txt | zstd -z8T8 >${DEV_SHELL}
if [[ ! $(tail -n 1 store-paths.txt) =~ "devx" ]]; then exit 1; fi
Expand Down
Loading