Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/fintermobilityas/warp in…
Browse files Browse the repository at this point in the history
…to develop
  • Loading branch information
peters committed Jul 6, 2020
2 parents cc8d950 + a7c3d6f commit 4d4a485
Showing 1 changed file with 68 additions and 38 deletions.
106 changes: 68 additions & 38 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,65 @@ jobs:
echo "::set-output name=CARGO_PKG_VERSION::$CARGO_PKG_VERSION":
echo "::set-output name=CARGO_PKG_AUTHORS::$CARGO_PKG_AUTHORS":
build-warp-runner-linux:
runs-on: ubuntu-latest
build-warp-runner-windows:
runs-on: windows-latest
name: Build WR ${{ matrix.target }}
needs: [setup]
env:
CARGO_PKG_VERSION: ${{ needs.setup.outputs.CARGO_PKG_VERSION }}
CARGO_PKG_AUTHORS: ${{ needs.setup.outputs.CARGO_PKG_AUTHORS }}
strategy:
matrix:
target: [i686-pc-windows-gnu, x86_64-pc-windows-gnu, x86_64-unknown-linux-gnu]
target: [i686-pc-windows-msvc, x86_64-pc-windows-msvc]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup target
run: rustup target add ${{ matrix.target }} --toolchain stable

- name: Install mingw
if: matrix.target == 'i686-pc-windows-gnu' || matrix.target == 'x86_64-pc-windows-gnu'
- name: Cache cargo registry
uses: actions/cache@v2
continue-on-error: true
with:
path: ~/.cargo/registry/cache
key: ${{ matrix.target }}-warp-runner-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ matrix.target }}-warp-runner-cargo-registry-
- name: Set cargo build metadata
shell: pwsh
run: ./ci/cargo.ps1 -Version ${{ env.CARGO_PKG_VERSION }} -Authors "${{ env.CARGO_PKG_AUTHORS }}"

- name: Build
run: |
sudo apt-get update && \
sudo apt-get install -y --no-install-recommends \
mingw-w64 g++-mingw-w64-x86-64 g++-mingw-w64-i686
cd ${{ github.workspace }}/warp-runner
cargo build --release --target ${{ matrix.target }}
- name: Upload artifacts
if: success()
uses: actions/upload-artifact@v2
with:
name: warp-runner-${{ matrix.target }}
path: ${{ github.workspace }}/target/${{ matrix.target }}/release/warp-runner*


build-warp-runner-linux:
runs-on: ubuntu-latest
name: Build WR ${{ matrix.target }}
needs: [setup]
env:
CARGO_PKG_VERSION: ${{ needs.setup.outputs.CARGO_PKG_VERSION }}
CARGO_PKG_AUTHORS: ${{ needs.setup.outputs.CARGO_PKG_AUTHORS }}
strategy:
matrix:
target: [x86_64-unknown-linux-gnu]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup target
run: rustup target add ${{ matrix.target }} --toolchain stable

- name: Cache cargo registry
uses: actions/cache@v2
Expand Down Expand Up @@ -120,30 +156,30 @@ jobs:
path: ${{ github.workspace }}/target/${{ env.RUST_TARGET }}/release/warp-runner

build-warp-packer-windows:
runs-on: ubuntu-latest
runs-on: windows-latest
name: Build WP ${{ matrix.target }}
needs: [setup, build-warp-runner-linux, build-warp-runner-osx]
needs: [setup, build-warp-runner-windows, build-warp-runner-linux, build-warp-runner-osx]
env:
CARGO_PKG_VERSION: ${{ needs.setup.outputs.CARGO_PKG_VERSION }}
CARGO_PKG_AUTHORS: ${{ needs.setup.outputs.CARGO_PKG_AUTHORS }}
strategy:
matrix:
target: [i686-pc-windows-gnu, x86_64-pc-windows-gnu]
target: [i686-pc-windows-msvc, x86_64-pc-windows-msvc]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Download warp runner (i686-pc-windows-gnu)
- name: Download warp runner (i686-pc-windows-msvc)
uses: actions/download-artifact@v2
with:
name: warp-runner-i686-pc-windows-gnu
path: ${{ github.workspace }}/target/i686-pc-windows-gnu/release
name: warp-runner-i686-pc-windows-msvc
path: ${{ github.workspace }}/target/i686-pc-windows-msvc/release

- name: Download warp runner (x86_64-pc-windows-gnu)
- name: Download warp runner (x86_64-pc-windows-msvc)
uses: actions/download-artifact@v2
with:
name: warp-runner-x86_64-pc-windows-gnu
path: ${{ github.workspace }}/target/x86_64-pc-windows-gnu/release
path: ${{ github.workspace }}/target/x86_64-pc-windows-msvc/release

- name: Download warp runner (x86_64-unknown-linux-gnu)
uses: actions/download-artifact@v2
Expand All @@ -157,12 +193,6 @@ jobs:
name: warp-runner-x86_64-apple-darwin
path: ${{ github.workspace }}/target/x86_64-apple-darwin/release

- name: Install mingw
run: |
sudo apt-get update && \
sudo apt-get install -y --no-install-recommends \
mingw-w64 g++-mingw-w64-x86-64 g++-mingw-w64-i686
- name: Setup ${{ matrix.target }}
run: rustup target add ${{ matrix.target }} --toolchain stable

Expand Down Expand Up @@ -194,7 +224,7 @@ jobs:
build-warp-packer-unix:
runs-on: ${{ matrix.os }}
name: Build WP ${{ matrix.os }}
needs: [setup, build-warp-runner-linux, build-warp-runner-osx]
needs: [setup, build-warp-runner-windows, build-warp-runner-linux, build-warp-runner-osx]
env:
CARGO_PKG_VERSION: ${{ needs.setup.outputs.CARGO_PKG_VERSION }}
CARGO_PKG_AUTHORS: ${{ needs.setup.outputs.CARGO_PKG_AUTHORS }}
Expand All @@ -205,17 +235,17 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Download warp runner (i686-pc-windows-gnu)
- name: Download warp runner (i686-pc-windows-msvc)
uses: actions/download-artifact@v2
with:
name: warp-runner-i686-pc-windows-gnu
path: ${{ github.workspace }}/target/i686-pc-windows-gnu/release
name: warp-runner-i686-pc-windows-msvc
path: ${{ github.workspace }}/target/i686-pc-windows-msvc/release

- name: Download warp runner (x86_64-pc-windows-gnu)
- name: Download warp runner (x86_64-pc-windows-msvc)
uses: actions/download-artifact@v2
with:
name: warp-runner-x86_64-pc-windows-gnu
path: ${{ github.workspace }}/target/x86_64-pc-windows-gnu/release
name: warp-runner-x86_64-pc-windows-msvc
path: ${{ github.workspace }}/target/x86_64-pc-windows-msvc/release

- name: Download warp runner (x86_64-unknown-linux-gnu)
uses: actions/download-artifact@v2
Expand Down Expand Up @@ -274,22 +304,22 @@ jobs:
runs-on: ubuntu-latest
if: success() && github.ref == 'refs/heads/master'
name: Publish release
needs: [setup, build-warp-runner-linux, build-warp-runner-osx, build-warp-packer-windows, build-warp-packer-unix]
needs: [setup, build-warp-runner-windows, build-warp-runner-linux, build-warp-runner-osx, build-warp-packer-windows, build-warp-packer-unix]
env:
CARGO_PKG_VERSION: ${{ needs.setup.outputs.CARGO_PKG_VERSION }}
steps:

- name: Download warp packer (i686-pc-windows-gnu)
- name: Download warp packer (i686-pc-windows-msvc)
uses: actions/download-artifact@v2
with:
name: warp-packer-i686-pc-windows-gnu
path: ${{ github.workspace }}/target/i686-pc-windows-gnu/release
name: warp-packer-i686-pc-windows-msvc
path: ${{ github.workspace }}/target/i686-pc-windows-msvc/release

- name: Download warp packer (x86_64-pc-windows-gnu)
- name: Download warp packer (x86_64-pc-windows-msvc)
uses: actions/download-artifact@v2
with:
name: warp-packer-x86_64-pc-windows-gnu
path: ${{ github.workspace }}/target/x86_64-pc-windows-gnu/release
name: warp-packer-x86_64-pc-windows-msvc
path: ${{ github.workspace }}/target/x86_64-pc-windows-msvc/release

- name: Download warp packer (x86_64-unknown-linux-gnu)
uses: actions/download-artifact@v2
Expand All @@ -305,8 +335,8 @@ jobs:

- name: Strip symbols
run: |
cp ${{ github.workspace }}/target/i686-pc-windows-gnu/release/warp-packer.exe windows-x86.warp-packer.exe
cp ${{ github.workspace }}/target/x86_64-pc-windows-gnu/release/warp-packer.exe windows-x64.warp-packer.exe
cp ${{ github.workspace }}/target/i686-pc-windows-msvc/release/warp-packer.exe windows-x86.warp-packer.exe
cp ${{ github.workspace }}/target/x86_64-pc-windows-msvc/release/warp-packer.exe windows-x64.warp-packer.exe
cp ${{ github.workspace }}/target/x86_64-unknown-linux-gnu/release/warp-packer linux-x64.warp-packer
cp ${{ github.workspace }}/target/x86_64-apple-darwin/release/warp-packer macos-x64.warp-packer
Expand Down

0 comments on commit 4d4a485

Please sign in to comment.