Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build release #61

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 0 additions & 71 deletions .github/workflows/coverage.yaml

This file was deleted.

234 changes: 117 additions & 117 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
platform:
- target: x86_64-unknown-linux-gnu
command: cargo
- target: aarch64-unknown-linux-gnu
command: cross
- target: x86_64-unknown-linux-musl
command: cross
- target: aarch64-unknown-linux-musl
command: cross
# - target: aarch64-unknown-linux-gnu
# command: cross
# - target: x86_64-unknown-linux-musl
# command: cross
# - target: aarch64-unknown-linux-musl
# command: cross

runs-on: ubuntu-latest

Expand Down Expand Up @@ -71,8 +71,8 @@ jobs:
echo "env=${TARGET##*-}" >> "$GITHUB_OUTPUT"
echo "arch=$(echo $TARGET | awk '{print $1}')" >> "$GITHUB_OUTPUT"
echo "docker-arch=${{ startsWith(matrix.platform.target, 'x86_64') && 'amd64' || 'arm64' }}" >> "$GITHUB_OUTPUT"
echo "profile=dev" >> "$GITHUB_OUTPUT"
echo "output-dir=debug" >> "$GITHUB_OUTPUT"
echo "profile=release" >> "$GITHUB_OUTPUT"
echo "output-dir=release" >> "$GITHUB_OUTPUT"
- name: Increase postgres max connection
run: |
docker exec -i postgres bash << EOF
Expand Down Expand Up @@ -176,127 +176,127 @@ jobs:
build-args: |
BASE_IMAGE=debian:12.5-slim
TARGET_ENV=gnu
platforms: linux/amd64,linux/arm64
platforms: linux/amd64
push: true
tags: ${{ steps.meta-gnu.outputs.tags }}

# Musl
- name: Extract metadata for Docker musl
id: meta-musl
uses: docker/metadata-action@v5
with:
images: |
name=ghcr.io/${{ github.repository }}-musl
tags: |
type=ref,event=pr
type=raw,value=develop,enable={{is_default_branch}}
- name: Build and push musl
uses: docker/build-push-action@v5
with:
context: .
file: ci/docker/Dockerfile
build-args: |
BASE_IMAGE=alpine:3.19.1
TARGET_ENV=musl
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta-musl.outputs.tags }}
# # Musl
# - name: Extract metadata for Docker musl
# id: meta-musl
# uses: docker/metadata-action@v5
# with:
# images: |
# name=ghcr.io/${{ github.repository }}-musl
# tags: |
# type=ref,event=pr
# type=raw,value=develop,enable={{is_default_branch}}
# - name: Build and push musl
# uses: docker/build-push-action@v5
# with:
# context: .
# file: ci/docker/Dockerfile
# build-args: |
# BASE_IMAGE=alpine:3.19.1
# TARGET_ENV=musl
# platforms: linux/amd64,linux/arm64
# push: true
# tags: ${{ steps.meta-musl.outputs.tags }}

build-windows:
runs-on: windows-latest
# build-windows:
# runs-on: windows-latest

steps:
- uses: actions/checkout@v4
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
# steps:
# - uses: actions/checkout@v4
# - name: Export GitHub Actions cache environment variables
# uses: actions/github-script@v7
# with:
# script: |
# core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
# core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
# - uses: dtolnay/rust-toolchain@master
# with:
# toolchain: ${{ env.RUST_TOOLCHAIN }}

- name: Install and setup postgres
run: |
curl https://get.enterprisedb.com/postgresql/postgresql-16.2-1-windows-x64-binaries.zip --output postgresql.zip
7z x postgresql.zip
$env:PGDATA = "$PWD\pgsql\data"
$env:PGPASSWORD = "postgres"
echo $env:PGPASSWORD > pwfile
pgsql\bin\initdb --username=postgres --encoding="UTF-8" --locale="en_US.UTF-8" --pwfile=pwfile
pgsql\bin\pg_ctl start
pgsql\bin\psql -U postgres -d postgres -c "ALTER SYSTEM SET max_connections = 1000"
pgsql\bin\psql -U postgres -d postgres -c "ALTER SYSTEM SET shared_buffers = '2GB'"
pgsql\bin\pg_ctl restart
echo "$PWD\pgsql\bin" >> $env:GITHUB_PATH
echo "$PWD\pgsql\lib" >> $env:GITHUB_PATH
echo "PQ_LIB_DIR=$PWD\pgsql\lib" >> $env:GITHUB_ENV
# - name: Install and setup postgres
# run: |
# curl https://get.enterprisedb.com/postgresql/postgresql-16.2-1-windows-x64-binaries.zip --output postgresql.zip
# 7z x postgresql.zip
# $env:PGDATA = "$PWD\pgsql\data"
# $env:PGPASSWORD = "postgres"
# echo $env:PGPASSWORD > pwfile
# pgsql\bin\initdb --username=postgres --encoding="UTF-8" --locale="en_US.UTF-8" --pwfile=pwfile
# pgsql\bin\pg_ctl start
# pgsql\bin\psql -U postgres -d postgres -c "ALTER SYSTEM SET max_connections = 1000"
# pgsql\bin\psql -U postgres -d postgres -c "ALTER SYSTEM SET shared_buffers = '2GB'"
# pgsql\bin\pg_ctl restart
# echo "$PWD\pgsql\bin" >> $env:GITHUB_PATH
# echo "$PWD\pgsql\lib" >> $env:GITHUB_PATH
# echo "PQ_LIB_DIR=$PWD\pgsql\lib" >> $env:GITHUB_ENV

- name: Install cargo-vcpkg
uses: taiki-e/cache-cargo-install-action@v1
with:
tool: cargo-vcpkg
- name: Build vcpkg dependencies
run: |
cargo vcpkg --verbose build --target x86_64-pc-windows-msvc
# - name: Install cargo-vcpkg
# uses: taiki-e/cache-cargo-install-action@v1
# with:
# tool: cargo-vcpkg
# - name: Build vcpkg dependencies
# run: |
# cargo vcpkg --verbose build --target x86_64-pc-windows-msvc

- name: Build and test
run: |
cargo test --locked --target x86_64-pc-windows-msvc
# - name: Build and test
# run: |
# cargo test --locked --target x86_64-pc-windows-msvc

build-macos:
strategy:
fail-fast: false
matrix:
platform:
- target: x86_64-apple-darwin
os: macos-13
vcpkg-target: x64-osx-release
- target: aarch64-apple-darwin
os: macos-14
vcpkg-target: arm64-osx-release
# build-macos:
# strategy:
# fail-fast: false
# matrix:
# platform:
# - target: x86_64-apple-darwin
# os: macos-13
# vcpkg-target: x64-osx-release
# - target: aarch64-apple-darwin
# os: macos-14
# vcpkg-target: arm64-osx-release

runs-on: ${{ matrix.platform.os }}
# runs-on: ${{ matrix.platform.os }}

env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
# env:
# HOMEBREW_NO_AUTO_UPDATE: 1
# HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1

steps:
- uses: actions/checkout@v4
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
# steps:
# - uses: actions/checkout@v4
# - name: Export GitHub Actions cache environment variables
# uses: actions/github-script@v7
# with:
# script: |
# core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
# core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
# - uses: dtolnay/rust-toolchain@master
# with:
# toolchain: ${{ env.RUST_TOOLCHAIN }}

- name: Install and setup postgres
run: |
brew uninstall --force postgresql
brew uninstall --force postgresql@14
brew install postgresql@16
brew link postgresql@16
export PGDATA="$RUNNER_TEMP/pgdata"
initdb --username=postgres --encoding="UTF-8" --locale="en_US.UTF-8" --pwfile=<(echo postgres)
pg_ctl start
psql -U postgres -d postgres -c "ALTER SYSTEM SET max_connections = 1000"
psql -U postgres -d postgres -c "ALTER SYSTEM SET shared_buffers = '2GB'"
pg_ctl restart
# - name: Install and setup postgres
# run: |
# brew uninstall --force postgresql
# brew uninstall --force postgresql@14
# brew install postgresql@16
# brew link postgresql@16
# export PGDATA="$RUNNER_TEMP/pgdata"
# initdb --username=postgres --encoding="UTF-8" --locale="en_US.UTF-8" --pwfile=<(echo postgres)
# pg_ctl start
# psql -U postgres -d postgres -c "ALTER SYSTEM SET max_connections = 1000"
# psql -U postgres -d postgres -c "ALTER SYSTEM SET shared_buffers = '2GB'"
# pg_ctl restart

- name: Install vcpkg build deps
run: brew install nasm
- name: Install cargo-vcpkg
uses: taiki-e/cache-cargo-install-action@v1
with:
tool: cargo-vcpkg
- name: Build vcpkg dependencies
run: |
cargo vcpkg --verbose build --target ${{ matrix.platform.target }}
# - name: Install vcpkg build deps
# run: brew install nasm
# - name: Install cargo-vcpkg
# uses: taiki-e/cache-cargo-install-action@v1
# with:
# tool: cargo-vcpkg
# - name: Build vcpkg dependencies
# run: |
# cargo vcpkg --verbose build --target ${{ matrix.platform.target }}

- name: Build and test
run: cargo test --locked --target ${{ matrix.platform.target }}
# - name: Build and test
# run: cargo test --locked --target ${{ matrix.platform.target }}
Loading