From 7ab9b9724ec56becf443d46e43e764e0b8bdda2e Mon Sep 17 00:00:00 2001 From: mappu Date: Mon, 9 Sep 2024 18:46:06 +1200 Subject: [PATCH 1/4] docker: add linux64-go1.19 dockerfile --- docker/linux64-go1.19-qt5.15-dynamic.Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 docker/linux64-go1.19-qt5.15-dynamic.Dockerfile diff --git a/docker/linux64-go1.19-qt5.15-dynamic.Dockerfile b/docker/linux64-go1.19-qt5.15-dynamic.Dockerfile new file mode 100644 index 00000000..333cc792 --- /dev/null +++ b/docker/linux64-go1.19-qt5.15-dynamic.Dockerfile @@ -0,0 +1,4 @@ +FROM debian:bookworm + +RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ + apt-get install -qyy gnupg2 golang-go qtbase5-dev ca-certificates From ea2fb76f97e3019234c71ceaa54efbe91ba6a12f Mon Sep 17 00:00:00 2001 From: mappu Date: Mon, 9 Sep 2024 18:46:52 +1200 Subject: [PATCH 2/4] ci: add initial github-actions yml pipeline --- .github/workflows/miqt.yml | 33 +++++++++++++++++++ .../linux64-go1.19-qt5.15-dynamic.Dockerfile | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/miqt.yml diff --git a/.github/workflows/miqt.yml b/.github/workflows/miqt.yml new file mode 100644 index 00000000..7d85dc91 --- /dev/null +++ b/.github/workflows/miqt.yml @@ -0,0 +1,33 @@ +name: miqt.yml + +on: + push: + branches: [ "**" ] + pull_request: + branches: [ "**" ] + +jobs: + build: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Linux64 docker build + run: cd docker && docker build -t miqt/linux64:latest -f linux64-go1.19-qt5.15-dynamic.Dockerfile . + + - name: Rebuild binding source + run: docker run -v $PWD:/src -w /src miqt/linux64:latest /bin/bash -c 'cd cmd/genbindings && go build && ./genbindings' + + - name: Assert no changes + run: git update-index --really-refresh && git diff-index HEAD + + - name: Linux64 bindings compile + run: docker run -v $PWD:/src -w /src miqt/linux64:latest /bin/bash -c 'cd qt && go build' + + - name: Win64 docker build + run: cd docker && docker build -t miqt/win64:latest -f win64-cross-go1.23-qt5.15-static.Dockerfile . + + - name: Win64 bindings compile + run: docker run -v $PWD:/src -w /src miqt/win64:latest /bin/bash -c 'cd qt && go build' diff --git a/docker/linux64-go1.19-qt5.15-dynamic.Dockerfile b/docker/linux64-go1.19-qt5.15-dynamic.Dockerfile index 333cc792..db101510 100644 --- a/docker/linux64-go1.19-qt5.15-dynamic.Dockerfile +++ b/docker/linux64-go1.19-qt5.15-dynamic.Dockerfile @@ -1,4 +1,4 @@ FROM debian:bookworm RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ - apt-get install -qyy gnupg2 golang-go qtbase5-dev ca-certificates + apt-get install -qyy gnupg2 golang-go qtbase5-dev ca-certificates clang From 0bcdf08fc0571645cd917852b3befec2c98170cf Mon Sep 17 00:00:00 2001 From: mappu Date: Mon, 9 Sep 2024 18:55:36 +1200 Subject: [PATCH 3/4] doc/README: add CI actions badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 74ed8ad2..d77f85e6 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ ![](https://img.shields.io/badge/License-MIT-green) [![Go Reference](https://pkg.go.dev/badge/github.com/mappu/miqt/qt.svg)](https://pkg.go.dev/github.com/mappu/miqt/qt) +[![GitHub Actions CI](https://github.com/mappu/miqt/actions/workflows/miqt.yml/badge.svg?branch=master)](https://github.com/mappu/miqt/actions) # MIQT From c15eb1a1f85832f52d10a6d4909b705b114e5487 Mon Sep 17 00:00:00 2001 From: mappu Date: Mon, 9 Sep 2024 19:47:32 +1200 Subject: [PATCH 4/4] ci: add caching, separate windows/linux jobs --- .github/workflows/miqt.yml | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/.github/workflows/miqt.yml b/.github/workflows/miqt.yml index 7d85dc91..9df545a2 100644 --- a/.github/workflows/miqt.yml +++ b/.github/workflows/miqt.yml @@ -1,4 +1,4 @@ -name: miqt.yml +name: CI on: push: @@ -7,7 +7,7 @@ on: branches: [ "**" ] jobs: - build: + miqt_linux64: runs-on: ubuntu-22.04 steps: @@ -17,17 +17,42 @@ jobs: - name: Linux64 docker build run: cd docker && docker build -t miqt/linux64:latest -f linux64-go1.19-qt5.15-dynamic.Dockerfile . + - name: Cache clang ASTs + uses: actions/cache@v4 + with: + path: cmd/genbindings/cachedir + key: linux64-clang-cache + + - name: Cache GOCACHE + uses: actions/cache@v4 + with: + path: ~/.cache/go-build + key: linux64-gocache + - name: Rebuild binding source - run: docker run -v $PWD:/src -w /src miqt/linux64:latest /bin/bash -c 'cd cmd/genbindings && go build && ./genbindings' + run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src miqt/linux64:latest /bin/bash -c 'cd cmd/genbindings && go build && ./genbindings' - name: Assert no changes run: git update-index --really-refresh && git diff-index HEAD - name: Linux64 bindings compile - run: docker run -v $PWD:/src -w /src miqt/linux64:latest /bin/bash -c 'cd qt && go build' + run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src miqt/linux64:latest /bin/bash -c 'cd qt && go build' + + miqt_win64: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Cache GOCACHE + uses: actions/cache@v4 + with: + path: ~/.cache/go-build + key: win64-gocache - name: Win64 docker build run: cd docker && docker build -t miqt/win64:latest -f win64-cross-go1.23-qt5.15-static.Dockerfile . - name: Win64 bindings compile - run: docker run -v $PWD:/src -w /src miqt/win64:latest /bin/bash -c 'cd qt && go build' + run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src miqt/win64:latest /bin/bash -c 'cd qt && go build'