Skip to content

Commit

Permalink
ci: Upgrade artifact actions to v4 (#4444)
Browse files Browse the repository at this point in the history
  • Loading branch information
max-sixty authored May 2, 2024
1 parent 1a45fbf commit d29f102
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 52 deletions.
7 changes: 3 additions & 4 deletions .github/actions/build-prqlc-c/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/build-prqlc/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 18 additions & 7 deletions .github/actions/build-python/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
6 changes: 4 additions & 2 deletions .github/actions/time-compilation/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: "
Expand Down
36 changes: 21 additions & 15 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -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
Expand All @@ -295,6 +299,7 @@ jobs:
with:
target: ${{ matrix.target }}
package: ${{ matrix.package }}
profile: release

publish-python:
runs-on: ubuntu-latest
Expand All @@ -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:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/test-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
25 changes: 5 additions & 20 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d29f102

Please sign in to comment.