Skip to content

Commit

Permalink
Merge pull request #1 from aryx/gha
Browse files Browse the repository at this point in the history
First GHA check using setup-ocaml@v2
  • Loading branch information
aryx authored Apr 19, 2024
2 parents c05ec87 + 26194ad commit 566fff5
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 79 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ all: $(OBJS)
clean:
rm -f $(OBJS)

format:
jsonnetfmt -i *.jsonnet

# for pad's codemap
.PHONY: gen-codemapignore
gen-codemapignore: $(OBJS)
Expand Down
92 changes: 35 additions & 57 deletions .github/workflows/build-and-test.jsonnet
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Build and test using setup-ocaml@v2 mostly.

// ----------------------------------------------------------------------------
// Helpers
// ----------------------------------------------------------------------------
Expand All @@ -6,75 +8,47 @@ local checkout = {
uses: 'actions/checkout@v3',
};

local build_script = |||
./configure
. ./env
mk
mk install
|||;

// ----------------------------------------------------------------------------
// The jobs
// The job
// ----------------------------------------------------------------------------

// Arch
local build_x86_linux_arch_job = {
local job = {
// LATER:
// strategy:
// fail-fast: false
// matrix:
// os:
// - macos-latest
// - ubuntu-latest
// - windows-latest
// ocaml-compiler:
// - "5.1"
//
// runs-on: ${{ matrix.os }}
'runs-on': 'ubuntu-latest',
container: 'archlinux',
steps: [
checkout,
{
uses: "ocaml/setup-ocaml@v2",
with: {
// TODO: ${{ matrix.ocaml-compiler }}
'ocaml-compiler': "4.02.1",
}
},
{
name: 'Install dependencies',
run: |||
pacman -Sy --noconfirm gcc lib32-glibc lib32-gcc-libs
echo No dependencies! This is xix! It does not need anything!
|||,
},
{
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',
name: 'Build mk/rc',
run: |||
sudo apt update
sudo apt-get install -y gcc-multilib
eval $(opam env)
./bootstrap-mk.sh
|||,
},
{
name: 'Build',
run: build_script,
}
]
],
};

// ----------------------------------------------------------------------------
Expand All @@ -93,10 +67,14 @@ local build_x86_linux_ubuntu_job = {
'master',
],
},
schedule: [
{
// every day at 12:59
cron: '59 12 * * *',
},
],
},
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,
job: job,
},
}
32 changes: 10 additions & 22 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,25 @@
# AUTOGENERATED FROM build-and-test.jsonnet DO NOT MODIFY
jobs:
build-x86-linux-arch:
container: archlinux
job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: 4.02.1
- name: Install dependencies
run: |
pacman -Sy --noconfirm gcc lib32-glibc lib32-gcc-libs
- name: Build
echo No dependencies! This is xix! It does not need anything!
- name: Build mk/rc
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
eval $(opam env)
./bootstrap-mk.sh
name: build-and-test
on:
pull_request: null
push:
branches:
- master
schedule:
- cron: 59 12 * * *
workflow_dispatch: null
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ clean:
# Developer targets
###############################################################################

pr:
git push origin `git rev-parse --abbrev-ref HEAD`
hub pull-request -b master

push:
git push origin `git rev-parse --abbrev-ref HEAD`

merge:
A=`git rev-parse --abbrev-ref HEAD` && git checkout master && git pull && git branch -D $$A

# See https://github.com/aryx/codemap
visual:
codemap -screen_size 3 -filter semgrep -efuns_client efuns_client -emacs_client /dev/null .

0 comments on commit 566fff5

Please sign in to comment.