Skip to content
Merged
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
84 changes: 84 additions & 0 deletions .github/actions/setup-rust/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: 'Setup Rust caching'
description: 'Swatinem/rust-cache + sccache.'

inputs:
shared-key:
description: 'Swatinem/rust-cache shared-key.'
required: false
default: ''
key:
description: 'Swatinem/rust-cache key.'
required: false
default: ''
workspaces:
description: 'Swatinem/rust-cache workspaces.'
required: false
default: '. -> target'
sccache:
description: 'Enable sccache as RUSTC_WRAPPER.'
required: false
default: 'true'
zig:
description: 'Install ziglang + cargo-zigbuild.'
required: false
default: 'false'
zig-version:
description: 'Zig version for mlugg/setup-zig.'
required: false
default: '0.16.0'
glibc-version:
description: 'Target glibc for cargo-zigbuild, exported as GLIBC_VERSION.'
required: false
default: '2.17'

runs:
using: 'composite'
steps:
- name: Exclude workspace from Windows Defender
if: ${{ runner.os == 'Windows' }}
shell: pwsh
run: Add-MpPreference -ExclusionPath "${{ github.workspace }}"

- name: Fast profile on PRs (no LTO)
if: ${{ github.event_name == 'pull_request' }}
shell: bash
run: |
echo "CARGO_PROFILE_RELEASE_LTO=false" >> "$GITHUB_ENV"
echo "CARGO_PROFILE_RELEASE_CODEGEN_UNITS=16" >> "$GITHUB_ENV"

- name: Install sccache
if: ${{ inputs.sccache == 'true' }}
uses: mozilla-actions/sccache-action@v0.0.10

- name: Enable sccache
if: ${{ inputs.sccache == 'true' }}
shell: bash
run: |
echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"

- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ inputs.shared-key }}
key: ${{ inputs.key }}
workspaces: ${{ inputs.workspaces }}

- name: Install zig
if: ${{ inputs.zig == 'true' }}
uses: mlugg/setup-zig@v2
with:
version: ${{ inputs.zig-version }}

- name: Install cargo-zigbuild
if: ${{ inputs.zig == 'true' }}
uses: taiki-e/install-action@v2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tool: cargo-zigbuild

- name: Export target glibc version
if: ${{ inputs.zig == 'true' }}
shell: bash
run: echo "GLIBC_VERSION=${{ inputs.glibc-version }}" >> "$GITHUB_ENV"
41 changes: 0 additions & 41 deletions .github/workflows/cargo-version-action-test.yaml

This file was deleted.

35 changes: 32 additions & 3 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,24 @@ env:
MACOSX_DEPLOYMENT_TARGET: '10.13'

on:
workflow_dispatch:
push:
branches:
- master
tags-ignore:
- '**'
paths:
- 'bindings/c/**'
- 'core/**'
- 'test-data/**'
- '.github/workflows/go.yaml'
pull_request:
paths:
- 'bindings/c/**'
- 'core/**'
- 'test-data/**'
- '.github/workflows/go.yaml'
release:
types: [published]

permissions: write-all

Expand Down Expand Up @@ -39,9 +56,19 @@ jobs:
toolchain: stable
override: true
target: ${{ matrix.settings.target }}
- uses: marcopolo/cargo@master
- uses: ./.github/actions/setup-rust
with:
shared-key: go-${{ matrix.settings.target }}
zig: ${{ matrix.settings.host == 'ubuntu-latest' }}

- name: Build (zig, linux)
if: ${{ matrix.settings.host == 'ubuntu-latest' }}
working-directory: bindings/c
run: cargo zigbuild --release --all-features --target ${{ matrix.settings.target }}.${{ env.GLIBC_VERSION }} --locked
- name: Build (native)
if: ${{ matrix.settings.host != 'ubuntu-latest' }}
uses: marcopolo/cargo@master
with:
use-cross: true
working-directory: bindings/c
args: --release --all-features --target=${{ matrix.settings.target }} --locked
command: build
Expand Down Expand Up @@ -84,6 +111,8 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
environment: release
if: "github.event_name == 'release' && startsWith(github.event.release.tag_name, 'go-v')"
needs:
- build
- copy-common
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/miri.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Miri

on:
workflow_dispatch:

permissions:
contents: read

env:
RUST_BACKTRACE: 1
RUSTUP_MAX_RETRIES: 10

jobs:
miri:
name: cargo miri test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup toolchain install nightly --component miri && rustup default nightly
- uses: ./.github/actions/setup-rust
with:
shared-key: rust-miri
sccache: 'false'
- run: cargo miri test --workspace --all-features
env:
MIRIFLAGS: -Zmiri-strict-provenance -Zmiri-symbolic-alignment-check -Zmiri-disable-isolation
RUSTFLAGS: ${{ env.RUSTFLAGS }} -Z randomize-layout
60 changes: 0 additions & 60 deletions .github/workflows/node-version-bump.yaml

This file was deleted.

Loading
Loading