Skip to content

Commit

Permalink
ci: add build on windows and macos (#14)
Browse files Browse the repository at this point in the history
* ci: add build on windows and macos

* build without test

* add vcpkg cache

* install libpq release only

* build release only
  • Loading branch information
vnghia authored Jan 22, 2024
1 parent cadd9c5 commit ec91c25
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
CARGO_TERM_COLOR: always

jobs:
build:
build-linux:
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -56,3 +56,32 @@ jobs:
run: cargo binstall cross --no-confirm
- name: Build and test
run: ${{ matrix.platform.command }} test --locked --target ${{ matrix.platform.target }}

# TODO: setup postgres instance for testing
build-windows:
runs-on: windows-latest

env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"

steps:
- uses: actions/checkout@v4
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install libpq
run: vcpkg install libpq:x64-windows-release
- name: Build
run: cargo build --locked --target x86_64-pc-windows-msvc

# TODO: setup postgres instance for testing
build-macos:
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --locked --target x86_64-apple-darwin

0 comments on commit ec91c25

Please sign in to comment.