Merge pull request #53 from sireliah/release-0.7.1 #122
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
test-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install deps | |
run: sudo apt update && sudo apt install libdbus-1-dev libgtk-3-dev libglib2.0-dev libcairo-gobject2 libpango1.0-dev libatk1.0-dev libgdk-pixbuf2.0-0 | |
- name: Build | |
run: cargo build --verbose | |
- name: Run tests | |
run: cargo test --verbose | |
gvsbuild: | |
runs-on: windows-2019 | |
env: | |
gvsbuildref: 679fa3bdf342ed2b199977b075da8263a04b3c05 | |
gvsbuildupdate: 1 | |
outputs: | |
cachekey: ${{ steps.output.outputs.cachekey }} | |
steps: | |
- name: (GTK binaries) create dir | |
run: mkdir C:\gtk-build\gtk\x64\release | |
- name: (GTK binaries) get from cache | |
uses: actions/cache@v2 | |
id: cache | |
with: | |
path: C:\gtk-build\gtk\x64\release\** | |
key: gvsbuild-${{ env.gvsbuildupdate }}-${{ env.gvsbuildref }} | |
- name: (GTK binaries) checkout gvsbuild | |
if: steps.cache.outputs.cache-hit != 'true' | |
uses: actions/checkout@v2 | |
with: | |
repository: wingtk/gvsbuild | |
ref: ${{ env.gvsbuildref }} | |
path: gvsbuild | |
- name: (GTK binaries) move git binary | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: move "C:\Program Files\Git\usr\bin" "C:\Program Files\Git\usr\notbin" | |
shell: cmd | |
- name: (GTK binaries) run gvsbuild | |
if: steps.cache.outputs.cache-hit != 'true' | |
working-directory: gvsbuild | |
run: python .\build.py build -p=x64 --vs-ver=16 --msys-dir=C:\msys64 gtk3 | |
- name: (GTK binaries) restore git binary | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: move "C:\Program Files\Git\usr\notbin" "C:\Program Files\Git\usr\bin" | |
shell: cmd | |
- name: (GTK binaries) output cache key | |
id: output | |
run: echo "::set-output name=cachekey::gvsbuild-${{ env.gvsbuildupdate }}-${{ env.gvsbuildref }}" | |
test-windows: | |
runs-on: windows-2019 | |
needs: gvsbuild | |
steps: | |
- name: Create GTK binaries dir | |
run: mkdir C:\gtk-build\gtk\x64\release | |
- name: Get GTK binaries from cache | |
uses: actions/cache@v2 | |
id: cache | |
with: | |
path: C:\gtk-build\gtk\x64\release\** | |
key: ${{ needs.gvsbuild.outputs.cachekey }} | |
- name: Set up env | |
run: | | |
echo "PKG_CONFIG=C:\gtk-build\gtk\x64\release\bin\pkgconf.exe" >> $GITHUB_ENV | |
echo "C:\gtk-build\gtk\x64\release\bin" >> $GITHUB_PATH | |
shell: bash | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
default: true | |
- name: Run tests | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --verbose |