diff --git a/.github/actions/build-prqlc-c/action.yaml b/.github/actions/build-prqlc-c/action.yaml index d08bd72df0b5..2b376eae451d 100644 --- a/.github/actions/build-prqlc-c/action.yaml +++ b/.github/actions/build-prqlc-c/action.yaml @@ -46,8 +46,7 @@ runs: - if: runner.os == 'Windows' && inputs.profile == 'release' shell: bash - run: | - echo 'RUSTFLAGS=-Ctarget-feature=+crt-static' >>"$GITHUB_ENV" + run: echo 'RUSTFLAGS=-Ctarget-feature=+crt-static' >>"$GITHUB_ENV" - if: inputs.target == 'aarch64-unknown-linux-musl' shell: bash @@ -88,9 +87,9 @@ runs: 7z a "../../../${ARTIFACT_NAME}" *prqlc_c* - name: Upload prqlc-c - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: prqlc_c-${{ inputs.target }} + name: prqlc_c-${{ inputs.target }}-${{ inputs.profile }} path: ${{ env.ARTIFACT_NAME }} - id: echo-artifact-name diff --git a/.github/actions/build-prqlc/action.yaml b/.github/actions/build-prqlc/action.yaml index b0ccdb3c1832..1db0a74146e1 100644 --- a/.github/actions/build-prqlc/action.yaml +++ b/.github/actions/build-prqlc/action.yaml @@ -93,9 +93,9 @@ runs: 7z a "../../../${ARTIFACT_NAME}" prqlc.exe ../../../LICENSE README.md - name: Upload prqlc - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: prqlc-${{ inputs.target }} + name: prqlc-${{ inputs.target }}-${{ inputs.profile }} path: ${{ env.ARTIFACT_NAME }} - id: echo-artifact-name diff --git a/.github/actions/build-python/action.yaml b/.github/actions/build-python/action.yaml index 91bb892cc8b7..6231c5d1e9d6 100644 --- a/.github/actions/build-python/action.yaml +++ b/.github/actions/build-python/action.yaml @@ -2,8 +2,13 @@ name: build-wheel description: "Use maturin to build python dists." inputs: target: - description: Build target, or 'source' for source distribution - required: false + description: + Maturin build target, or 'source' for source distribution. Currently only + used for Linux, otherwise defaults to the platform. + required: true + profile: + description: Build profile option; `dev` or `release`. + required: true package: description: Package name required: true @@ -30,24 +35,30 @@ runs: manylinux: auto command: build args: - --release -o target/python -m + --profile=${{ inputs.profile }} -o target/python -m ${{steps.package-path.outputs.package_path}} - uses: PyO3/maturin-action@v1 if: runner.os == 'Windows' && inputs.target != 'source' with: command: build args: - --release -o target/python -m + --profile=${{ inputs.profile }} -o target/python -m ${{steps.package-path.outputs.package_path}} - uses: PyO3/maturin-action@v1 if: runner.os == 'macOS' && inputs.target != 'source' with: command: build + # We override the target with `universal2-apple-darwin`. Probably we + # should use the target from the input or at least ensure it matches. args: - --release -o target/python --target universal2-apple-darwin -m + --profile=${{ inputs.profile }} -o target/python --target + universal2-apple-darwin -m ${{steps.package-path.outputs.package_path}} - name: Upload wheels - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: ${{ inputs.package }}-wheels + name: + # We could avoid the OS here if we handled the target more explicitly. + ${{ inputs.package }}-${{ runner.os }}-${{ inputs.target }}-${{ + inputs.profile }} path: target/python diff --git a/.github/actions/time-compilation/action.yaml b/.github/actions/time-compilation/action.yaml index 619a3f44a6b7..b642d84dbadb 100644 --- a/.github/actions/time-compilation/action.yaml +++ b/.github/actions/time-compilation/action.yaml @@ -29,9 +29,11 @@ runs: with: command: build args: --timings --all-targets - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: - name: cargo-timing.html + name: + cargo-timing-${{ inputs.use_cache == 'true' && 'cache' || 'no_cache' + }}.html path: target/cargo-timings/cargo-timing-*.html if-no-files-found: error # Only upload if a) we got a cache hit or b) we didn't want to use the cache anyway diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 42ef86a53120..e86a161f8ce9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -43,6 +43,7 @@ updates: - "/" - ".github/actions/build-python" - ".github/actions/build-prqlc" + - ".github/actions/build-prqlc-c" - ".github/actions/time-compilation" commit-message: prefix: "chore: " diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1788d2b74b86..71c678b87776 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -137,10 +137,9 @@ jobs: permissions: contents: write steps: - - name: Download a Build Artifact - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: prqlc-${{ matrix.target }} + name: prqlc-${{ matrix.target }}-release - name: Copy files into .deb package run: | tar -xf prqlc-*.tar.gz @@ -171,11 +170,10 @@ jobs: PRQL is a modern language for transforming data — a simple, powerful, pipelined SQL replacement. - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: - name: artifact-deb - path: | - ./*.deb + name: deb-${{ matrix.target }} + path: ./*.deb - name: Release if: github.event_name == 'release' uses: softprops/action-gh-release@v2 @@ -194,10 +192,9 @@ jobs: permissions: contents: write steps: - - name: Download a Build Artifact - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: prqlc-${{ matrix.target }} + name: prqlc-${{ matrix.target }}-release - name: Copy files into .rpm package run: | tar -xf prqlc-*.tar.gz @@ -230,7 +227,7 @@ jobs: PRQL is a modern language for transforming data — a simple, powerful, pipelined SQL replacement. license: Apache-2.0 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: artifact-rpm path: | @@ -269,13 +266,20 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-latest, macos-14, windows-latest] + os: [ubuntu-latest, windows-latest] package: - prqlc-python - lutra-python target: [x86_64] - # Also produce more targets for ubuntu: include: + # MacOS with universal builds + - os: macos-14 + package: prqlc-python + target: universal2-apple-darwin + - os: macos-14 + package: lutra-python + target: universal2-apple-darwin + # Also produce more targets for ubuntu: - os: ubuntu-latest package: prqlc-python target: aarch64 @@ -295,6 +299,7 @@ jobs: with: target: ${{ matrix.target }} package: ${{ matrix.package }} + profile: release publish-python: runs-on: ubuntu-latest @@ -306,9 +311,10 @@ jobs: - prqlc-python - lutra-python steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: ${{ matrix.package }}-wheels + # `*` covers target & OS + pattern: ${{ matrix.package }}-*-release - name: Publish to PyPI uses: PyO3/maturin-action@v1 env: diff --git a/.github/workflows/test-python.yaml b/.github/workflows/test-python.yaml index 661ce6bd2a44..335bd488e068 100644 --- a/.github/workflows/test-python.yaml +++ b/.github/workflows/test-python.yaml @@ -26,9 +26,11 @@ jobs: with: target: ${{ matrix.os == 'ubuntu-latest' && 'x86_64' || '' }} package: prqlc-python - - uses: actions/download-artifact@v3 + profile: dev + - uses: actions/download-artifact@v4 with: - name: prqlc-python-wheels + # `*` covers all targets (we could make this explicit...) + pattern: prqlc-python-${{ runner.os }}-*-dev path: target/python - uses: actions/setup-python@v5 with: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 52679a78ebc9..e0e995564540 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -414,17 +414,15 @@ jobs: save-if: ${{ github.ref == 'refs/heads/main' }} prefix-key: ${{ env.version }} - run: - # TODO: move to using `codecov.json` since that has branch & region - # coverage. But the coverage is lower, and I haven't spent the time to - # evaluate whether that's accurate or not yet. - # - # cargo llvm-cov --codecov --output-path=codecov.json --features=test-dbs + # We considered moving to using `codecov.json` with + # `--codecov --output-path=codecov.json` since that has branch & region + # coverage. But the coverage is lower, in a way that doesn't represent + # what is useful coverage cargo llvm-cov --cobertura --output-path=cobertura.xml --no-default-features --features=default,test-dbs - name: Upload to codecov.io uses: codecov/codecov-action@v4 with: - # files: codecov.json files: cobertura.xml fail_ci_if_error: true # This isn't strictly necessary, but as discussed in @@ -437,10 +435,9 @@ jobs: # that.) token: ${{ secrets.CODECOV_TOKEN }} - name: Upload code coverage results - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: code-coverage-report - # path: codecov.json path: cobertura.xml test-grammars: @@ -482,17 +479,6 @@ jobs: # This needs to compare to the string `'true'`, because of GHA awkwardness push: ${{ needs.rules.outputs.devcontainer-push == 'true' }} - time-compilation: - runs-on: ubuntu-latest - needs: rules - if: needs.rules.outputs.nightly == 'true' - steps: - - name: 📂 Checkout code - uses: actions/checkout@v4 - - uses: ./.github/actions/time-compilation - with: - use_cache: true - test-msrv: runs-on: ubuntu-latest needs: rules @@ -560,7 +546,6 @@ jobs: - test-rust - test-rust-main - test-taskfile - - time-compilation runs-on: ubuntu-latest steps: - name: Decide whether the needed jobs succeeded or failed