Skip to content

Commit

Permalink
Add CI build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
epilys committed Apr 11, 2022
1 parent e725a1f commit 98def85
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 1 deletion.
96 changes: 96 additions & 0 deletions .github/workflows/builds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: profile.release builds

env:
RUST_BACKTRACE: 1

on:
push:
branches:
- '**'

jobs:
build:
name: Build on ${{ matrix.build }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build: [linux-amd64, macos-x86_64] #, linux-aarch64, macos-arm64]
include:
- build: linux-amd64
os: ubuntu-latest
rust: stable
artifact_name: 'gerb-linux-amd64'
target: x86_64-unknown-linux-gnu
- build: macos-x86_64
os: macos-latest
rust: stable
target: x86_64-apple-darwin
artifact_name: 'gerb-darwin-amd64'
#- build: linux-aarch64
# os: ubuntu-latest
# rust: stable
# target: aarch64-unknown-linux-gnu
# artifact_name: 'gerb-linux-aarch64'
#- build: macos-arm64
# os: macos-latest
# rust: stable
# target: aarch64-apple-darwin
# artifact_name: 'gerb-darwin-arm64'
steps:
- uses: actions/checkout@v2
- name: Install Rust ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
- name: Configure cargo data directory
# After this point, all cargo registry and crate data is stored in
# $GITHUB_WORKSPACE/.cargo_home. This allows us to cache only the files
# that are needed during the build process. Additionally, this works
# around a bug in the 'cache' action that causes directories outside of
# the workspace dir to be saved/restored incorrectly.
run: echo "CARGO_HOME=$(pwd)/.cargo_home" >> $GITHUB_ENV
- name: Setup Rust target
if: matrix.target
run: |
mkdir -p .cargo
cat << EOF > .cargo/config.toml
[build]
target = "${{ matrix.target }}"
EOF
- name: Install dependencies (macos x86_64)
if: matrix.os == 'macos-latest' && matrix.target == 'x86_64-apple-darwin'
shell: bash
run: |
set -ex
brew install librsvg gtk+3
- name: Install dependencies (macos arm64)
if: matrix.os == 'macos-latest' && matrix.target == 'aarch64-apple-darwin'
shell: bash
run: |
set -ex
#arch -arm64e bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
#arch -arm64e brew install librsvg gtk+3
#brew fetch --force --deps --bottle-tag=arm64_big_sur librsvg gtk+3 | tee brew.out
#for t in `grep "Downloaded to" < brew.out | cut -f 3 -d ' '`; do
# brew install "$t"
#done
- name: Install dependencies (linux)
if: matrix.os == 'ubuntu-latest'
run: |
set -ex
sudo apt install libgtk-3-dev
- name: Build binary
run: |
cargo build --release
mv target/*/release/gerb target/gerb || true
mv target/release/gerb target/gerb || true
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.artifact_name }}
path: target/gerb
if-no-files-found: error
retention-days: 30
2 changes: 1 addition & 1 deletion src/views/glyphs_overview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ impl ObjectImpl for GlyphsArea {
match pspec.name() {
"tab-title" => "overview".to_value(),
"tab-can-close" => false.to_value(),
_ => unreachable!(pspec.name()),
_ => unreachable!("{}", pspec.name()),
}
}
}
Expand Down

0 comments on commit 98def85

Please sign in to comment.