Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
37f5385
preliminary library action and reflow
altendky Dec 31, 2024
abae76c
Updating dependabot configuration
ChiaAutomation Dec 31, 2024
fc8949c
test the action not the reflow (for now)
altendky Dec 31, 2024
a733ee1
maybe
altendky Dec 31, 2024
1e5b47e
hmm
altendky Dec 31, 2024
6cddf0c
debug
altendky Dec 31, 2024
0a65fc0
yeah
altendky Dec 31, 2024
185a2a3
single line
altendky Dec 31, 2024
cfb80e5
from json
altendky Dec 31, 2024
b2caaad
well
altendky Dec 31, 2024
9712578
oh yeah
altendky Dec 31, 2024
8bb6888
'
altendky Dec 31, 2024
1ebae34
try to test the reflow again
altendky Dec 31, 2024
f1c88e4
i assume i did a thing like this before and it does not work
altendky Dec 31, 2024
a86a7d1
download it
altendky Dec 31, 2024
50f5fb9
oh yeah
altendky Dec 31, 2024
d5ec093
better url
altendky Dec 31, 2024
3546f24
id
altendky Dec 31, 2024
80376d7
debug
altendky Dec 31, 2024
d5e4a1f
url again
altendky Dec 31, 2024
29c9bae
curl -e
altendky Dec 31, 2024
78c48f8
just the reflow
altendky Dec 31, 2024
98de860
test a matrix
altendky Dec 31, 2024
2fc6273
Updating dependabot configuration
ChiaAutomation Dec 31, 2024
76512d7
again
altendky Dec 31, 2024
6c07a18
oh yeah, runs-on
altendky Dec 31, 2024
ee4454a
hmm
altendky Dec 31, 2024
89483e5
yep
altendky Dec 31, 2024
9b749a4
debug
altendky Dec 31, 2024
fee593c
more debug
altendky Dec 31, 2024
a6310e9
maybe
altendky Dec 31, 2024
92bc0f1
err
altendky Dec 31, 2024
c937a3e
well
altendky Dec 31, 2024
77a42c3
yuppers
altendky Dec 31, 2024
753730a
tidy
altendky Dec 31, 2024
5245529
well
altendky Dec 31, 2024
6db1376
more common
altendky Dec 31, 2024
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
38 changes: 38 additions & 0 deletions .github/workflows/reflow-library.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "📚 Library"

on:
workflow_call:
inputs:
url:
default: https://raw.githubusercontent.com/Chia-Network/actions/refs/heads/main/library/library.yaml
type: string
outputs:
root:
description: "The root of the library JSON"
value: ${{ jobs.library.outputs.root }}

concurrency:
# SHA is added to the end if on `main` to let all main workflows run
group: ${{ github.ref }}-${{ github.workflow }}-${{ inputs.distribution-name }}-${{ github.event_name }}-${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || '' }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
cancel-in-progress: true

defaults:
run:
shell: bash

permissions:
id-token: write
contents: read

jobs:
library:
name: "📚 Library"
runs-on: ubuntu-latest
outputs:
root: ${{ steps.library.outputs.root }}

steps:
- name: Download and output library
id: library
run: |
( echo -n "root=" && curl -esSL "${{ inputs.url }}" | yq -o=json -I=0 ) | tee -a "${GITHUB_OUTPUT}"
58 changes: 58 additions & 0 deletions .github/workflows/test-library.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: test-library

on:
push:
branches:
- main
tags:
- "**"
pull_request:
branches:
- "**"

concurrency:
# SHA is added to the end if on `main` to let all main workflows run
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
library:
uses: ./.github/workflows/reflow-library.yml
with:
url: https://raw.githubusercontent.com/Chia-Network/actions/${{ github.sha }}/library/library.yaml

test:
name: Test library contents available
runs-on: ubuntu-latest
needs: library
timeout-minutes: 5

steps:
- name: Check a number
env:
EXIT_CODE: ${{ (fromJSON(needs.library.outputs.root)._test.a-number == 1) && '0' || '1' }}
run: |
exit ${EXIT_CODE}

- name: Check an alias
env:
EXIT_CODE: ${{ (fromJSON(needs.library.outputs.root)._test.an-alias == 'red') && '0' || '1' }}
run: |
exit ${EXIT_CODE}

test_matrix:
name: ${{ matrix.os.emoji }}${{ matrix.arch.emoji }} Test a library matrix
runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }}
needs: library
timeout-minutes: 5
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.library.outputs.root).matrix.complete.standard_installer_python }}
steps:
- name: Dump the matrix
run: |
echo "${{ toJSON(matrix) }}" | yq --prettyPrint
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,7 @@ Generate a new SSH key and have vault sign it with the SSH CA
### workflows/docker/build

Job definition that builds a docker image and pushes to ghcr.io

### .github/workflows/reflow-library.yml

Job definition that retrieves the library for workflows
97 changes: 97 additions & 0 deletions library/library.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
_test:
a-number: 1
an-anchor: &_test_anchor 'red'
an-alias: *_test_anchor
emoji:
os:
- linux: &emoji_os_linux 🐧
- macos: &emoji_os_macos 🍎
- windows: &emoji_os_windows 🪟
arch:
- arm: &emoji_arch_arm 💪
- intel: &emoji_arch_intel 🌀
- risc: &emoji_arch_risc ✳️
matrix:
elements:
os:
linux: &matrix_elements_os_linux
name: Linux
emoji: *emoji_os_linux
matrix: &linux linux
runs-on:
arm: [Linux, ARM64]
intel: [ubuntu-latest]
macos: &matrix_elements_os_macos
name: macOS
emoji: *emoji_os_macos
matrix: &macos macos
runs-on:
arm: [macos-latest]
intel: [macos-13]
windows: &matrix_elements_os_windows
name: Windows
emoji: *emoji_os_windows
matrix: &windows windows
runs-on:
intel: [windows-latest]
all: &matrix_elements_os_all
- <<: *matrix_elements_os_linux
- <<: *matrix_elements_os_macos
- <<: *matrix_elements_os_windows
python:
'3.9': &matrix_elements_python_3_9
major-dot-minor: '3.9'
cibw-build: 'cp39-*'
'3.10': &matrix_elements_python_3_10
major-dot-minor: '3_10'
cibw-build: 'cp310-*'
'3.11': &matrix_elements_python_3_11
major-dot-minor: '3_11'
cibw-build: 'cp311-*'
'3.12': &matrix_elements_python_3_12
major-dot-minor: '3_12'
cibw-build: 'cp312-*'
installer: &matrix_elements_python_installers
<<: *matrix_elements_python_3_10
all: &matrix_elements_python_all
- <<: *matrix_elements_python_3_9
- <<: *matrix_elements_python_3_10
- <<: *matrix_elements_python_3_11
- <<: *matrix_elements_python_3_12
arch:
arm: &matrix_elements_arch_arm
name: ARM
emoji: *emoji_arch_arm
matrix: &arm arm
intel: &matrix_elements_arch_intel
name: Intel
emoji: *emoji_arch_intel
matrix: &intel intel
risc: &matrix_elements_arch_risc
name: RISC
emoji: *emoji_arch_risc
matrix: &risc risc
arm_intel: &matrix_elements_arch_arm_intel
- <<: *matrix_elements_arch_arm
- <<: *matrix_elements_arch_intel
all: &matrix_elements_arch_all
- <<: *matrix_elements_arch_arm
- <<: *matrix_elements_arch_intel
- <<: *matrix_elements_arch_risc
excludes: &matrix_excludes
- os:
matrix: *windows
arch:
matrix: *arm
complete:
standard_installer_python:
os: *matrix_elements_os_all
python:
- <<: *matrix_elements_python_installers
arch: *matrix_elements_arch_arm_intel
exclude: *matrix_excludes
standard_all_python:
os: *matrix_elements_os_all
python: *matrix_elements_python_all
arch: *matrix_elements_arch_arm_intel
exclude: *matrix_excludes
14 changes: 14 additions & 0 deletions library/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Retrieve the library for workflows

```yaml
jobs:
library:
uses: Chia-Network/actions/.github/workflows/reflow-library.yml

test:
# <snip>
steps:
- name: Echo a test value
run: |
echo ${{ fromJSON(needs.library.outputs.root)._test.an-anchor }}
```