-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
179 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Makefile to automatically convert the .jsonnet GHA workflows | ||
# to .yml (GHA accepts only the YAML format). | ||
|
||
LIBS = | ||
OBJS = build-and-test.yml | ||
|
||
all: $(OBJS) | ||
|
||
%.yml: %.jsonnet $(LIBS) | ||
echo "# AUTOGENERATED FROM $< DO NOT MODIFY" > $@ | ||
./jsonnet_to_yaml.sh $< >> $@ || { rm -f $@; exit 1; } | ||
|
||
clean: | ||
rm -f $(OBJS) | ||
|
||
# for pad's codemap | ||
.PHONY: gen-codemapignore | ||
gen-codemapignore: $(OBJS) | ||
rm -f .codemapignore | ||
for i in $(OBJS); do \ | ||
echo $$i >> .codemapignore; \ | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
// ---------------------------------------------------------------------------- | ||
// Helpers | ||
// ---------------------------------------------------------------------------- | ||
|
||
local checkout = { | ||
uses: 'actions/checkout@v3', | ||
}; | ||
|
||
local build_script = ||| | ||
./configure | ||
. ./env | ||
mk | ||
mk install | ||
|||; | ||
|
||
// ---------------------------------------------------------------------------- | ||
// The jobs | ||
// ---------------------------------------------------------------------------- | ||
|
||
// Arch | ||
local build_x86_linux_arch_job = { | ||
'runs-on': 'ubuntu-latest', | ||
container: 'archlinux', | ||
steps: [ | ||
checkout, | ||
{ | ||
name: 'Install dependencies', | ||
run: ||| | ||
pacman -Sy --noconfirm gcc lib32-glibc lib32-gcc-libs | ||
|||, | ||
}, | ||
{ | ||
name: 'Build', | ||
run: build_script, | ||
} | ||
] | ||
}; | ||
|
||
// Alpine | ||
//local build_x86_linux_alpine_job = { | ||
// 'runs-on': 'ubuntu-latest', | ||
// // alpine does not support gcc-multilib like ubuntu/arch | ||
// // so simpler to start from a 32 bits alpine image | ||
// // But this does not seem to work well with GHA :( | ||
// container: 'i386/alpine', | ||
// steps: [ | ||
// checkout, | ||
// { | ||
// name: 'Install dependencies', | ||
// run: ||| | ||
// apk add bash gcc | ||
// |||, | ||
// }, | ||
// { | ||
// name: 'Build', | ||
// run: build_script, | ||
// } | ||
// ] | ||
//}; | ||
// Ubuntu | ||
local build_x86_linux_ubuntu_job = { | ||
'runs-on': 'ubuntu-latest', | ||
steps: [ | ||
checkout, | ||
{ | ||
name: 'Install dependencies', | ||
run: ||| | ||
sudo apt update | ||
sudo apt-get install -y gcc-multilib | ||
|||, | ||
}, | ||
{ | ||
name: 'Build', | ||
run: build_script, | ||
} | ||
] | ||
}; | ||
// ---------------------------------------------------------------------------- | ||
// The workflow | ||
// ---------------------------------------------------------------------------- | ||
{ | ||
name: 'build-and-test', | ||
on: { | ||
// can be run manually from the GHA dashboard | ||
workflow_dispatch: null, | ||
// on the PR | ||
pull_request: null, | ||
// and another time once the PR is merged on master | ||
push: { | ||
branches: [ | ||
'master', | ||
], | ||
}, | ||
}, | ||
jobs: { | ||
'build-x86-linux-arch': build_x86_linux_arch_job, | ||
//'build-x86-linux-alpine': build_x86_linux_alpine_job, | ||
'build-x86-linux-ubuntu': build_x86_linux_ubuntu_job, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# AUTOGENERATED FROM build-and-test.jsonnet DO NOT MODIFY | ||
jobs: | ||
build-x86-linux-arch: | ||
container: archlinux | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install dependencies | ||
run: | | ||
pacman -Sy --noconfirm gcc lib32-glibc lib32-gcc-libs | ||
- name: Build | ||
run: | | ||
./configure | ||
. ./env | ||
mk | ||
mk install | ||
build-x86-linux-ubuntu: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt-get install -y gcc-multilib | ||
- name: Build | ||
run: | | ||
./configure | ||
. ./env | ||
mk | ||
mk install | ||
name: build-and-test | ||
on: | ||
pull_request: null | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
# This script requires to have: | ||
# - jsonnet (any jsonnet should work, e.g., go-jsonnet) | ||
# - yq (a.k.a go-yq) from https://github.com/mikefarah/yq | ||
# Note that many distributions come with a default yq that is not | ||
# as powerful as https://github.com/mikefarah/yq so follow | ||
# the instructions there to install yq on your machine | ||
# | ||
# The sed command is because 'on' is printed with or without quotes depending | ||
# on the version. It's a dirty hack that may break some input. | ||
|
||
jsonnet "$@" \ | ||
| yq eval -P \ | ||
| sed -e 's/^\( *\)"on":/\1on:/' \ | ||
| sed -e 's/: "yes"$/: yes/' |