Skip to content

Commit

Permalink
ci: build prqlc on PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
eitsupi committed May 14, 2023
1 parent 442e1d2 commit 10632c3
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/actions/build-prqlc/action.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
20 changes: 20 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 || "" }}

0 comments on commit 10632c3

Please sign in to comment.