From f40144604af28f2d96547f8bc7d25b3463c490e3 Mon Sep 17 00:00:00 2001 From: eitsupi Date: Sun, 14 May 2023 09:08:14 +0000 Subject: [PATCH 01/14] ci: build prqlc on PRs --- .github/actions/build-prqlc/action.yaml | 40 +++++++++++++++++++++++++ .github/workflows/pull-request.yaml | 20 +++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .github/actions/build-prqlc/action.yaml diff --git a/.github/actions/build-prqlc/action.yaml b/.github/actions/build-prqlc/action.yaml new file mode 100644 index 000000000000..18fa712dc7f9 --- /dev/null +++ b/.github/actions/build-prqlc/action.yaml @@ -0,0 +1,40 @@ +name: build-prqlc +description: > + Build prqlc +inputs: + target: + description: Build target + required: true + cross: + description: Use cross? + required: false + default: "false" + +runs: + using: composite + steps: + - uses: Swatinem/rust-cache@v2 + with: + save-if: ${{ github.ref == 'refs/heads/main' }} + prefix-key: 0.8.1 + + - name: cargo build + uses: richb-hanover/cargo@v1.1.0 + with: + command: build + use-cross: inputs.cross == 'true' + args: --package prqlc --release --locked --target=${{ inputs.target }} + + - if: runner.os == 'Windows' + shell: powershell + run: echo "BIN_NAME=prqlc.exe" >>"$env:GITHUB_ENV" + + - if: runner.os != 'Windows' + shell: bash + run: echo "BIN_NAME=prqlc" >>"$GITHUB_ENV" + + - name: Upload prqlc + uses: actions/upload-artifact@v3 + with: + name: prqlc-${{ inputs.target }} + path: target/${{ inputs.target }}/release/${{ env.BIN_NAME }} diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 3d7d4820f1fd..0ef3698bbfd0 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -108,3 +108,23 @@ jobs: allowed-failures: check-links allowed-skips: test-all, publish-web, nightly jobs: ${{ toJSON(needs) }} + + build-prqlc: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + include: + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + - os: macos-latest + target: x86_64-apple-darwin + - os: windows-latest + target: x86_64-pc-windows-msvc + steps: + - name: 📂 Checkout code + uses: actions/checkout@v3 + - uses: ./.github/actions/build-prqlc + with: + target: ${{ matrix.target }} + cross: ${{ matrix.cross || '' }} From 68ee268f922a55282e6481f46ec7aa1ceb3a20b0 Mon Sep 17 00:00:00 2001 From: eitsupi Date: Sun, 14 May 2023 09:27:43 +0000 Subject: [PATCH 02/14] ci: make prqlc executable --- .github/actions/build-prqlc/action.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/build-prqlc/action.yaml b/.github/actions/build-prqlc/action.yaml index 18fa712dc7f9..e89f795dff24 100644 --- a/.github/actions/build-prqlc/action.yaml +++ b/.github/actions/build-prqlc/action.yaml @@ -31,7 +31,9 @@ runs: - if: runner.os != 'Windows' shell: bash - run: echo "BIN_NAME=prqlc" >>"$GITHUB_ENV" + run: | + echo "BIN_NAME=prqlc" >>"$GITHUB_ENV" + chmod +x target/${{ inputs.target }}/release/prqlc - name: Upload prqlc uses: actions/upload-artifact@v3 From 19a4a72f1f9e2ba51fdf098ecf3420c23151d363 Mon Sep 17 00:00:00 2001 From: eitsupi Date: Sun, 14 May 2023 09:37:26 +0000 Subject: [PATCH 03/14] ci: gnu -> musl --- .github/actions/build-prqlc/action.yaml | 3 +++ .github/workflows/pull-request.yaml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/actions/build-prqlc/action.yaml b/.github/actions/build-prqlc/action.yaml index e89f795dff24..1f7984026e7a 100644 --- a/.github/actions/build-prqlc/action.yaml +++ b/.github/actions/build-prqlc/action.yaml @@ -13,6 +13,9 @@ inputs: runs: using: composite steps: + - run: rustup target add ${{ inputs.target }} + shell: bash + - uses: Swatinem/rust-cache@v2 with: save-if: ${{ github.ref == 'refs/heads/main' }} diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 0ef3698bbfd0..83363ad38541 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -116,7 +116,7 @@ jobs: matrix: include: - os: ubuntu-latest - target: x86_64-unknown-linux-gnu + target: x86_64-unknown-linux-musl - os: macos-latest target: x86_64-apple-darwin - os: windows-latest From 801c28de0c14f8315144920c5f856c1107071014 Mon Sep 17 00:00:00 2001 From: eitsupi Date: Sun, 14 May 2023 09:56:34 +0000 Subject: [PATCH 04/14] ci: add lacked package --- .github/actions/build-prqlc/action.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/actions/build-prqlc/action.yaml b/.github/actions/build-prqlc/action.yaml index 1f7984026e7a..b829855cae78 100644 --- a/.github/actions/build-prqlc/action.yaml +++ b/.github/actions/build-prqlc/action.yaml @@ -21,6 +21,12 @@ runs: save-if: ${{ github.ref == 'refs/heads/main' }} prefix-key: 0.8.1 + - if: runner.os == 'Linux' + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y musl-tools + - name: cargo build uses: richb-hanover/cargo@v1.1.0 with: From 201922964492f4f0b59377df6bdfcafd74cb0965 Mon Sep 17 00:00:00 2001 From: eitsupi Date: Sun, 14 May 2023 10:11:50 +0000 Subject: [PATCH 05/14] ci: add Linux and macOS arm64 targets --- .github/workflows/pull-request.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 83363ad38541..40a07ea8cdac 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -115,10 +115,14 @@ jobs: fail-fast: true matrix: include: + - os: ubuntu-latest + target: x86_64-unknown-linux-musl - os: ubuntu-latest target: x86_64-unknown-linux-musl - os: macos-latest target: x86_64-apple-darwin + - os: macos-latest + target: aarch64-apple-darwin - os: windows-latest target: x86_64-pc-windows-msvc steps: From 769a9469b2a7c9a79ecb01d799ec9ffdf88a72ae Mon Sep 17 00:00:00 2001 From: eitsupi Date: Sun, 14 May 2023 10:12:54 +0000 Subject: [PATCH 06/14] ci: remove unused option --- .github/actions/build-prqlc/action.yaml | 5 ----- .github/workflows/pull-request.yaml | 1 - 2 files changed, 6 deletions(-) diff --git a/.github/actions/build-prqlc/action.yaml b/.github/actions/build-prqlc/action.yaml index b829855cae78..6d696f320598 100644 --- a/.github/actions/build-prqlc/action.yaml +++ b/.github/actions/build-prqlc/action.yaml @@ -5,10 +5,6 @@ inputs: target: description: Build target required: true - cross: - description: Use cross? - required: false - default: "false" runs: using: composite @@ -31,7 +27,6 @@ runs: uses: richb-hanover/cargo@v1.1.0 with: command: build - use-cross: inputs.cross == 'true' args: --package prqlc --release --locked --target=${{ inputs.target }} - if: runner.os == 'Windows' diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 40a07ea8cdac..7e8585a857f2 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -131,4 +131,3 @@ jobs: - uses: ./.github/actions/build-prqlc with: target: ${{ matrix.target }} - cross: ${{ matrix.cross || '' }} From 3d1239a1bcef5b1898cbf9dd6885fe595250a803 Mon Sep 17 00:00:00 2001 From: eitsupi Date: Sun, 14 May 2023 10:14:35 +0000 Subject: [PATCH 07/14] ci: fix target name --- .github/workflows/pull-request.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 7e8585a857f2..85fed4ea7001 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -118,7 +118,7 @@ jobs: - os: ubuntu-latest target: x86_64-unknown-linux-musl - os: ubuntu-latest - target: x86_64-unknown-linux-musl + target: aarch64-unknown-linux-musl - os: macos-latest target: x86_64-apple-darwin - os: macos-latest From 7253d5f9132951bb88126e38d13a225e916644c9 Mon Sep 17 00:00:00 2001 From: eitsupi Date: Sun, 14 May 2023 11:00:23 +0000 Subject: [PATCH 08/14] ci: add settings for linux arm64 build --- .github/actions/build-prqlc/action.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/actions/build-prqlc/action.yaml b/.github/actions/build-prqlc/action.yaml index 6d696f320598..c741c39084a2 100644 --- a/.github/actions/build-prqlc/action.yaml +++ b/.github/actions/build-prqlc/action.yaml @@ -23,6 +23,14 @@ runs: sudo apt-get update sudo apt-get install -y musl-tools + - if: inputs.target == 'aarch64-unknown-linux-musl' + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y gcc-aarch64-linux-gnu + echo 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc' >>"$GITHUB_ENV" + echo 'RUSTFLAGS=-C link-arg=-lgcc' >>"$GITHUB_ENV" + - name: cargo build uses: richb-hanover/cargo@v1.1.0 with: From c0d385144d1ebdf3b384db6f8f76330b2632fc7a Mon Sep 17 00:00:00 2001 From: eitsupi Date: Sun, 14 May 2023 11:28:40 +0000 Subject: [PATCH 09/14] ci: disable linux aarch64 --- .github/workflows/pull-request.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 85fed4ea7001..aa5c4c9b0405 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -117,8 +117,9 @@ jobs: include: - os: ubuntu-latest target: x86_64-unknown-linux-musl - - os: ubuntu-latest - target: aarch64-unknown-linux-musl + # TODO: Linux arm64 build + # - os: ubuntu-latest + # target: aarch64-unknown-linux-musl - os: macos-latest target: x86_64-apple-darwin - os: macos-latest From daa15e3d53d2c550cc78a9806ecae0f824e0d673 Mon Sep 17 00:00:00 2001 From: eitsupi Date: Mon, 15 May 2023 04:20:37 +0000 Subject: [PATCH 10/14] ci: remove unused lines --- .github/actions/build-prqlc/action.yaml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/actions/build-prqlc/action.yaml b/.github/actions/build-prqlc/action.yaml index c741c39084a2..ec5daa6ebed8 100644 --- a/.github/actions/build-prqlc/action.yaml +++ b/.github/actions/build-prqlc/action.yaml @@ -29,7 +29,6 @@ runs: sudo apt-get update sudo apt-get install -y gcc-aarch64-linux-gnu echo 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc' >>"$GITHUB_ENV" - echo 'RUSTFLAGS=-C link-arg=-lgcc' >>"$GITHUB_ENV" - name: cargo build uses: richb-hanover/cargo@v1.1.0 @@ -37,16 +36,6 @@ runs: command: build args: --package prqlc --release --locked --target=${{ inputs.target }} - - if: runner.os == 'Windows' - shell: powershell - run: echo "BIN_NAME=prqlc.exe" >>"$env:GITHUB_ENV" - - - if: runner.os != 'Windows' - shell: bash - run: | - echo "BIN_NAME=prqlc" >>"$GITHUB_ENV" - chmod +x target/${{ inputs.target }}/release/prqlc - - name: Upload prqlc uses: actions/upload-artifact@v3 with: From 133bbfd322aaa73ccbff9c3da617e81d35dd5ba2 Mon Sep 17 00:00:00 2001 From: eitsupi <50911393+eitsupi@users.noreply.github.com> Date: Mon, 15 May 2023 13:21:09 +0900 Subject: [PATCH 11/14] Update .github/actions/build-prqlc/action.yaml Co-authored-by: Maximilian Roos <5635139+max-sixty@users.noreply.github.com> --- .github/actions/build-prqlc/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build-prqlc/action.yaml b/.github/actions/build-prqlc/action.yaml index ec5daa6ebed8..3572d3fd067f 100644 --- a/.github/actions/build-prqlc/action.yaml +++ b/.github/actions/build-prqlc/action.yaml @@ -40,4 +40,4 @@ runs: uses: actions/upload-artifact@v3 with: name: prqlc-${{ inputs.target }} - path: target/${{ inputs.target }}/release/${{ env.BIN_NAME }} + path: target/${{ inputs.target }}/release/${{ runner.os == 'Windows' && 'prqlc.exe' || 'prqlc' }} From 42f5f7b1caecf97de8b0f853a49727f150de6c5e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 15 May 2023 04:21:23 +0000 Subject: [PATCH 12/14] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/actions/build-prqlc/action.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/build-prqlc/action.yaml b/.github/actions/build-prqlc/action.yaml index 3572d3fd067f..ca8e2298fdf8 100644 --- a/.github/actions/build-prqlc/action.yaml +++ b/.github/actions/build-prqlc/action.yaml @@ -40,4 +40,6 @@ runs: uses: actions/upload-artifact@v3 with: name: prqlc-${{ inputs.target }} - path: target/${{ inputs.target }}/release/${{ runner.os == 'Windows' && 'prqlc.exe' || 'prqlc' }} + path: + target/${{ inputs.target }}/release/${{ runner.os == 'Windows' && + 'prqlc.exe' || 'prqlc' }} From a5903ec674187b10b8a7804c9c16800784f1aac8 Mon Sep 17 00:00:00 2001 From: eitsupi Date: Mon, 15 May 2023 14:36:32 +0000 Subject: [PATCH 13/14] ci: enable arm64 Linux build of prqlc --- .github/actions/build-prqlc/action.yaml | 1 + .github/workflows/pull-request.yaml | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/build-prqlc/action.yaml b/.github/actions/build-prqlc/action.yaml index ca8e2298fdf8..9c9579dd8595 100644 --- a/.github/actions/build-prqlc/action.yaml +++ b/.github/actions/build-prqlc/action.yaml @@ -29,6 +29,7 @@ runs: sudo apt-get update sudo apt-get install -y gcc-aarch64-linux-gnu echo 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc' >>"$GITHUB_ENV" + echo 'CC=aarch64-linux-gnu-gcc' >>"$GITHUB_ENV" - name: cargo build uses: richb-hanover/cargo@v1.1.0 diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index aa5c4c9b0405..85fed4ea7001 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -117,9 +117,8 @@ jobs: include: - os: ubuntu-latest target: x86_64-unknown-linux-musl - # TODO: Linux arm64 build - # - os: ubuntu-latest - # target: aarch64-unknown-linux-musl + - os: ubuntu-latest + target: aarch64-unknown-linux-musl - os: macos-latest target: x86_64-apple-darwin - os: macos-latest From 05a8d757b1feda5a770f49de28967d26c03825b9 Mon Sep 17 00:00:00 2001 From: eitsupi Date: Mon, 15 May 2023 15:33:21 +0000 Subject: [PATCH 14/14] ci: set auto updating prefix key --- prql-compiler/Cargo.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/prql-compiler/Cargo.toml b/prql-compiler/Cargo.toml index 0db94e5ef8a4..c82cfea093c4 100644 --- a/prql-compiler/Cargo.toml +++ b/prql-compiler/Cargo.toml @@ -114,5 +114,11 @@ file = "../.github/actions/build-prql-python/action.yaml" replace = 'prefix-key: {{version}}' search = 'prefix-key: [\d.]+' +[[package.metadata.release.pre-release-replacements]] +exactly = 1 +file = "../.github/actions/build-prqlc/action.yaml" +replace = 'prefix-key: {{version}}' +search = 'prefix-key: [\d.]+' + [features] test-external-dbs = []