From 35267910146b2f6b746361f1ae6f7bae3da00711 Mon Sep 17 00:00:00 2001 From: Benjamin Lefaudeux Date: Mon, 30 Sep 2024 21:52:10 +0200 Subject: [PATCH] Build gopy package on the fly --- .github/workflows/go.yml | 41 +++++++++++++++++++------------------- .github/workflows/gopy.yml | 41 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/gopy.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 1020b2e..7b0e5a4 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -5,34 +5,33 @@ name: Go on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] jobs: - - build: + build_and_test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: '1.20' + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: "1.20" - - name: Install linux deps - run: | - sudo apt-get update - sudo apt-get -y install libvips-dev + - name: Install linux deps + run: | + sudo apt-get update + sudo apt-get -y install libvips-dev - - name: Build - run: cd src/cmd/main && go build -v main.go + - name: Build + run: cd src/cmd/main && go build -v main.go - - name: Test - env: - DATAROOM_API_KEY: ${{ secrets.DATAROOM_API_KEY }} - DATAROOM_TEST_SOURCE: ${{ secrets.DATAROOM_TEST_SOURCE }} - DATAROOM_API_URL: ${{ secrets.DATAROOM_API_URL }} + - name: Test + env: + DATAROOM_API_KEY: ${{ secrets.DATAROOM_API_KEY }} + DATAROOM_TEST_SOURCE: ${{ secrets.DATAROOM_TEST_SOURCE }} + DATAROOM_API_URL: ${{ secrets.DATAROOM_API_URL }} - run: cd src/tests && go test -v . + run: cd src/tests && go test -v . diff --git a/.github/workflows/gopy.yml b/.github/workflows/gopy.yml new file mode 100644 index 0000000..e704d43 --- /dev/null +++ b/.github/workflows/gopy.yml @@ -0,0 +1,41 @@ +# This workflow will build a gopy project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: Gopy + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install linux deps + run: | + sudo apt-get update + sudo apt-get -y install libvips-dev libjpeg-turbo8-dev + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: "1.23" + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.11" + + - name: Install pybindgen + run: | + python3 -m pip install pybindgen + go install golang.org/x/tools/cmd/goimports@latest + go install github.com/go-python/gopy@latest + + - name: Build + run: | + cd src/pkg/client && gopy pkg -author="Photoroom" -email="team@photoroom.com" -url="" -name="datago" -version="0.99" .