Skip to content
Closed
Show file tree
Hide file tree
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
92 changes: 92 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Build Release

on:
workflow_call:
inputs:
version:
required: true
type: string
use_cache:
required: false
type: boolean
default: true

jobs:
build:
name: Build Infix ${{ inputs.version }} [${{ matrix.target }}]
runs-on: [ self-hosted, release ]
strategy:
matrix:
target: [aarch64, x86_64]
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
clean: true
submodules: recursive

- name: Set Release Variables
id: vars
run: |
ver=${{ inputs.version }}
echo "ver=${ver}" >> $GITHUB_OUTPUT
fver=${ver#v}
target=${{ matrix.target }}-${fver}
echo "dir=infix-$target" >> $GITHUB_OUTPUT
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT

- name: Restore Cache of dl/
if: ${{ inputs.use_cache }}
uses: actions/cache@v4
with:
path: dl/
key: dl-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
restore-keys: |
dl-

- name: Restore Cache of .ccache/
if: ${{ inputs.use_cache }}
uses: actions/cache@v4
with:
path: .ccache/
key: ccache-${{ matrix.target }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
restore-keys: |
ccache-${{ matrix.target }}-
ccache-

- name: Configure & Build
env:
INFIX_RELEASE: ${{ steps.vars.outputs.ver }}
run: |
target=${{ matrix.target }}_defconfig
echo "Building $target ..."
make $target
make

- name: Generate SBOM from Build
run: |
make legal-info

- name: Build test specification
run: |
make test-spec

- name: Prepare Artifacts
run: |
cd output/
mv images ${{ steps.vars.outputs.dir }}
ln -s ${{ steps.vars.outputs.dir }} images
tar cfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}

mv legal-info legal-info-${{ matrix.target }}-${{ steps.vars.outputs.ver }}
tar cfz legal-info-${{ matrix.target }}-${{ steps.vars.outputs.ver }}.tar.gz legal-info-${{ matrix.target }}-${{ steps.vars.outputs.ver }}

- uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.target }}
path: output/*.tar.gz

- uses: actions/upload-artifact@v4
with:
name: artifact-disk-image-${{ matrix.target }}
path: output/images/*.qcow2
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ on:
parallel:
required: false
type: boolean
default: false
default: true

env:
NAME: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.name || inputs.name }}
Expand Down
84 changes: 12 additions & 72 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,87 +18,27 @@ on:
type: string

jobs:
build:
set-version:
if: github.repository == 'kernelkit/infix' && startsWith(github.ref, 'refs/tags/')
name: Build Infix ${{ github.ref_name }} [${{ matrix.target }}]
runs-on: [ self-hosted, release ]
strategy:
matrix:
target: [aarch64, x86_64]
fail-fast: false
runs-on: ubuntu-latest
outputs:
version: ${{ steps.set-ver.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
clean: true
submodules: recursive

- name: Set Release Variables
id: vars
- id: set-ver
run: |
if [ -n "${{ inputs.version }}" ]; then
ver=${{ inputs.version }}
else
ver=${GITHUB_REF#refs/tags/}
fi
echo "ver=${ver}" >> $GITHUB_OUTPUT
fver=${ver#v}
target=${{ matrix.target }}-${fver}
echo "dir=infix-$target" >> $GITHUB_OUTPUT
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT

- name: Restore Cache of dl/
uses: actions/cache@v4
with:
path: dl/
key: dl-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
restore-keys: |
dl-

- name: Restore Cache of .ccache/
uses: actions/cache@v4
with:
path: .ccache/
key: ccache-${{ matrix.target }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
restore-keys: |
ccache-${{ matrix.target }}-
ccache-

- name: Configure & Build
env:
INFIX_RELEASE: ${{ steps.vars.outputs.ver }}
run: |
target=${{ matrix.target }}_defconfig
echo "Building $target ..."
make $target
make
echo "version=${ver}" >> $GITHUB_OUTPUT

- name: Generate SBOM from Build
run: |
make legal-info

- name: Build test specification
run: |
make test-spec

- name: Prepare Artifacts
run: |
cd output/
mv images ${{ steps.vars.outputs.dir }}
ln -s ${{ steps.vars.outputs.dir }} images
tar cfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}

mv legal-info legal-info-${{ matrix.target }}-${{ steps.vars.outputs.ver }}
tar cfz legal-info-${{ matrix.target }}-${{ steps.vars.outputs.ver }}.tar.gz legal-info-${{ matrix.target }}-${{ steps.vars.outputs.ver }}

- uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.target }}
path: output/*.tar.gz

- uses: actions/upload-artifact@v4
with:
name: artifact-disk-image-${{ matrix.target }}
path: output/images/*.qcow2
build:
needs: set-version
uses: ./.github/workflows/build-release.yml
with:
version: ${{ needs.set-version.outputs.version }}
use_cache: true

release:
name: Release Infix ${{ github.ref_name }}
Expand Down
52 changes: 40 additions & 12 deletions .github/workflows/trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,62 @@ on:
- ci-work
workflow_dispatch:

concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
# Gate all builds through this check to prevent duplicate runs when a PR is
# created with the ci:main label already attached. Without this, both the
# 'opened' and 'labeled' events would trigger separate builds. Only run on
# 'labeled' events when the label is actually 'ci:main'. See issue #1154.
check-trigger:
if: |
startsWith(github.repository, 'kernelkit/') &&
(github.event_name != 'pull_request' ||
github.event.action != 'labeled' ||
github.event.label.name == 'ci:main')
runs-on: ubuntu-latest
outputs:
x86_64_target: ${{ steps.set-targets.outputs.x86_64_target }}
aarch64_target: ${{ steps.set-targets.outputs.aarch64_target }}
steps:
- run: |
echo "Triggering build ——————————————————————————————————————————————"
echo "Event : ${{ github.event_name }}"
echo "Action : ${{ github.event.action }}"
echo "Ref : ${{ github.ref }}"
echo "PR : ${{ github.event.pull_request.number }}"
echo "Label : ${{ github.event.label.name }}"
- id: set-targets
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]] && \
! echo '${{ toJSON(github.event.pull_request.labels.*.name) }}' \
| grep -q "ci:main"; then
echo "x86_64_target=x86_64_minimal" >> $GITHUB_OUTPUT
echo "aarch64_target=aarch64_minimal" >> $GITHUB_OUTPUT
else
echo "x86_64_target=x86_64" >> $GITHUB_OUTPUT
echo "aarch64_target=aarch64" >> $GITHUB_OUTPUT
fi

build-x86_64:
if: startsWith(github.repository, 'kernelkit/')
needs: check-trigger
uses: ./.github/workflows/build.yml
with:
name: "infix"
target: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'ci:main') && 'x86_64_minimal' || 'x86_64' }}
target: ${{ needs.check-trigger.outputs.x86_64_target }}

build-aarch64:
if: startsWith(github.repository, 'kernelkit/')
needs: check-trigger
uses: ./.github/workflows/build.yml
with:
name: "infix"
target: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'ci:main') && 'aarch64_minimal' || 'aarch64' }}
target: ${{ needs.check-trigger.outputs.aarch64_target }}

test-run-x86_64:
if: startsWith(github.repository, 'kernelkit/')
needs: build-x86_64
needs: [check-trigger, build-x86_64]
uses: ./.github/workflows/test.yml
with:
target: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'ci:main') && 'x86_64_minimal' || 'x86_64' }}
target: ${{ needs.check-trigger.outputs.x86_64_target }}
name: "infix"

test-publish-x86_64:
if: startsWith(github.repository, 'kernelkit/')
needs: test-run-x86_64
uses: ./.github/workflows/publish.yml
75 changes: 75 additions & 0 deletions .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Weekly release build to catch flaky tests and verify clean builds.
# Runs without caches (ccache) to ensure reproducibility. See issue #1003.
name: Weekly Build

on:
schedule:
- cron: '5 0 * * 6' # Saturday at 00:05 UTC, same as Coverity
workflow_dispatch:

jobs:
build:
if: github.repository == 'kernelkit/infix'
uses: ./.github/workflows/build-release.yml
with:
version: "latest"
use_cache: false

publish:
name: Publish Weekly Build
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: "artifact-*"
merge-multiple: true

- name: Create checksums
run: |
for file in *.tar.gz; do
sha256sum $file > $file.sha256
done
if ls *.qcow2 &>/dev/null; then
for file in *.qcow2; do
sha256sum "$file" > "$file.sha256"
done
fi

- name: Update latest tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -f latest
git push -f origin latest

- uses: ncipollo/release-action@v1
with:
tag: latest
name: "Latest Weekly Build"
prerelease: true
makeLatest: false
allowUpdates: true
removeArtifacts: true
body: |
Automated weekly build from `${{ github.sha }}`.

This build runs without caches to catch potential flaky tests and build issues.
Not intended for production use - use official releases instead.

**Commit:** ${{ github.sha }}
**Built:** ${{ github.run_id }}
artifacts: "*.tar.gz*,*.qcow2*"

- name: Summary
run: |
cat <<EOF >> $GITHUB_STEP_SUMMARY
# Weekly Build Published! :package:

Latest artifacts uploaded to:
<https://github.com/kernelkit/infix/releases/tag/latest>

Built from commit: \`${{ github.sha }}\`
EOF
2 changes: 1 addition & 1 deletion test/9pm
Submodule 9pm updated 92 files
+14 −4 .github/workflows/main.yml
+125 −237 9pm.py
+23 −13 Makefile
+67 −19 README.md
+ doc/overview3.png
+0 −76 lib_tcl/README.md
+0 −80 lib_tcl/arg.tcl
+0 −41 lib_tcl/config.tcl
+0 −76 lib_tcl/console.tcl
+0 −41 lib_tcl/db.tcl
+0 −6 lib_tcl/examples/conf.yaml
+0 −36 lib_tcl/examples/execute.tcl
+0 −12 lib_tcl/examples/local.tcl
+0 −35 lib_tcl/examples/output_show.tcl
+0 −21 lib_tcl/examples/ssh.tcl
+0 −9 lib_tcl/examples/suites/nested.yaml
+0 −5 lib_tcl/examples/suites/nested2.yaml
+0 −12 lib_tcl/examples/suites/run-me.yaml
+0 −5 lib_tcl/examples/suites/test.sh
+0 −13 lib_tcl/examples/test_fail.tcl
+0 −13 lib_tcl/examples/test_ok.tcl
+0 −282 lib_tcl/execute.tcl
+0 −133 lib_tcl/helpers.tcl
+0 −97 lib_tcl/init.tcl
+0 −104 lib_tcl/login.tcl
+0 −244 lib_tcl/output.tcl
+0 −16 lib_tcl/pkgAll.tcl
+0 −21 lib_tcl/pkgIndex.tcl
+0 −85 lib_tcl/scp.tcl
+0 −28 lib_tcl/shell.tcl
+0 −93 lib_tcl/spawn.tcl
+0 −59 lib_tcl/ssh.tcl
+413 −0 report.py
+10 −0 unit_tests/all.yaml
+0 −14 unit_tests/auto.yaml
+0 −5 unit_tests/harness/onfail.yaml
+0 −13 unit_tests/harness/onfail_check.tcl
+0 −7 unit_tests/harness/onfail_fail.tcl
+0 −7 unit_tests/harness/onfail_run.tcl
+0 −55 unit_tests/harness/options.tcl
+0 −29 unit_tests/harness/options.yaml
+0 −2 unit_tests/harness/options_nested.yaml
+0 −13 unit_tests/harness/suite_skip.tcl
+0 −11 unit_tests/harness/suite_skip.yaml
+8 −0 unit_tests/hello-world.sh
+0 −17 unit_tests/lib_tcl/all.yaml
+0 −4 unit_tests/lib_tcl/args/args.yaml
+0 −11 unit_tests/lib_tcl/args/cmdl_args.tcl
+0 −1 unit_tests/lib_tcl/args/cmdl_conf.yaml
+0 −11 unit_tests/lib_tcl/args/env_args.tcl
+0 −1 unit_tests/lib_tcl/args/env_conf.yaml
+0 −10 unit_tests/lib_tcl/args/noopt.sh
+0 −13 unit_tests/lib_tcl/args/noopt.tcl
+0 −10 unit_tests/lib_tcl/args/precedence.sh
+0 −47 unit_tests/lib_tcl/config/config.tcl
+0 −12 unit_tests/lib_tcl/config/config.yaml
+0 −6 unit_tests/lib_tcl/config/test.yaml
+0 −4 unit_tests/lib_tcl/db/db.yaml
+0 −19 unit_tests/lib_tcl/db/db_read.tcl
+0 −20 unit_tests/lib_tcl/db/db_scratch.tcl
+0 −11 unit_tests/lib_tcl/db/db_write.tcl
+0 −119 unit_tests/lib_tcl/execute/execute.tcl
+0 −2 unit_tests/lib_tcl/execute/execute.yaml
+0 −500 unit_tests/lib_tcl/execute/testdata
+0 −31 unit_tests/lib_tcl/helpers/getopts.tcl
+0 −4 unit_tests/lib_tcl/helpers/helpers.yaml
+0 −59 unit_tests/lib_tcl/helpers/retry_test.tcl
+0 −17 unit_tests/lib_tcl/helpers/root_path.tcl
+0 −36 unit_tests/lib_tcl/logging/logging.tcl
+0 −2 unit_tests/lib_tcl/logging/logging.yaml
+0 −4 unit_tests/lib_tcl/shell/shell.yaml
+0 −52 unit_tests/lib_tcl/shell/shell_active.tcl
+0 −32 unit_tests/lib_tcl/shell/shell_stack.tcl
+0 −46 unit_tests/lib_tcl/shell/shell_test.tcl
+0 −20 unit_tests/lib_tcl/tap/plan.sh
+0 −23 unit_tests/lib_tcl/tap/tap.tcl
+0 −41 unit_tests/lib_tcl/tap/tap.yaml
+0 −12 unit_tests/lib_tcl/tap/test.tcl
+0 −0 unit_tests/report/Readme.adoc
+0 −0 unit_tests/report/all.yaml
+0 −0 unit_tests/report/dynamic/bash.adoc
+0 −0 unit_tests/report/dynamic/bash.sh
+0 −0 unit_tests/report/dynamic/dynamic.yaml
+0 −0 unit_tests/report/test.pl
+32 −0 unit_tests/result/all.yaml
+36 −0 unit_tests/result/any.sh
+8 −0 unit_tests/result/fail.sh
+8 −0 unit_tests/result/pass.sh
+8 −0 unit_tests/result/skip.sh
+0 −9 unit_tests/run.sh
+0 −4 unit_tests/sanity/dummy.sh
+0 −13 unit_tests/sanity/noopt.tcl
Loading