fix Windows CI to fail when commands fail, use fixed terminal package (#214)

* fix windows CI

* use fixed terminal package

Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
This commit is contained in:
Efim Poberezkin 2022-01-21 00:19:39 +04:00 committed by GitHub
parent 65b17c9d18
commit 32a105bac8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 18 deletions

View file

@ -4,7 +4,7 @@ on:
push: push:
branches: branches:
- master - master
- v4 - stable
tags: tags:
- "v*" - "v*"
pull_request: pull_request:
@ -49,24 +49,15 @@ jobs:
include: include:
- os: ubuntu-20.04 - os: ubuntu-20.04
cache_path: ~/.stack cache_path: ~/.stack
stack_args: "--test"
artifact_rel_path: /bin/simplex-chat
asset_name: simplex-chat-ubuntu-20_04-x86-64 asset_name: simplex-chat-ubuntu-20_04-x86-64
- os: ubuntu-18.04 - os: ubuntu-18.04
cache_path: ~/.stack cache_path: ~/.stack
stack_args: "--test"
artifact_rel_path: /bin/simplex-chat
asset_name: simplex-chat-ubuntu-18_04-x86-64 asset_name: simplex-chat-ubuntu-18_04-x86-64
- os: macos-latest - os: macos-latest
cache_path: ~/.stack cache_path: ~/.stack
stack_args: "--test"
artifact_rel_path: /bin/simplex-chat
asset_name: simplex-chat-macos-x86-64 asset_name: simplex-chat-macos-x86-64
# TODO enable tests for windows once fixed (remove stack_args altogether)
- os: windows-latest - os: windows-latest
cache_path: C:/sr cache_path: C:/sr
stack_args: ""
artifact_rel_path: /bin/simplex-chat.exe
asset_name: simplex-chat-windows-x86-64 asset_name: simplex-chat-windows-x86-64
steps: steps:
- name: Clone project - name: Clone project
@ -85,17 +76,49 @@ jobs:
path: ${{ matrix.cache_path }} path: ${{ matrix.cache_path }}
key: ${{ matrix.os }}-${{ hashFiles('stack.yaml') }} key: ${{ matrix.os }}-${{ hashFiles('stack.yaml') }}
- name: Build & test # / Unix
id: build_test
- name: Unix build
id: unix_build
if: matrix.os != 'windows-latest'
shell: bash
run: | run: |
stack build ${{ matrix.stack_args }} stack build --test
echo "::set-output name=LOCAL_INSTALL_ROOT::$(stack path --local-install-root)" echo "::set-output name=LOCAL_INSTALL_ROOT::$(stack path --local-install-root)"
- name: Upload binaries to release - name: Unix upload binary to release
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v') && matrix.os != 'windows-latest'
uses: svenstaro/upload-release-action@v2 uses: svenstaro/upload-release-action@v2
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.build_test.outputs.LOCAL_INSTALL_ROOT }}${{ matrix.artifact_rel_path }} file: ${{ steps.unix_build.outputs.LOCAL_INSTALL_ROOT }}/bin/simplex-chat
asset_name: ${{ matrix.asset_name }} asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }} tag: ${{ github.ref }}
# Unix /
# / Windows
# * In powershell multiline commands do not fail if individual commands fail - https://github.community/t/multiline-commands-on-windows-do-not-fail-if-individual-commands-fail/16753
# * And GitHub Actions does not support parameterizing shell in a matrix job - https://github.community/t/using-matrix-to-specify-shell-is-it-possible/17065
# * So we're running a separate set of actions for Windows build
# TODO run tests on Windows
- name: Windows build
id: windows_build
if: matrix.os == 'windows-latest'
shell: cmd
run: |
stack build
echo "::set-output name=LOCAL_INSTALL_ROOT::$(stack path --local-install-root)"
- name: Windows upload binary to release
if: startsWith(github.ref, 'refs/tags/v') && matrix.os == 'windows-latest'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.windows_build.outputs.LOCAL_INSTALL_ROOT }}/bin/simplex-chat.exe
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
# Windows /

View file

@ -9,4 +9,4 @@ source-repository-package
source-repository-package source-repository-package
type: git type: git
location: git://github.com/simplex-chat/haskell-terminal.git location: git://github.com/simplex-chat/haskell-terminal.git
tag: 5e0759ce4f9655fd3f0d94c76225e6904630dfd3 tag: f708b00009b54890172068f168bf98508ffcd495

View file

@ -39,7 +39,7 @@ extra-deps:
- simple-logger-0.1.0@sha256:be8ede4bd251a9cac776533bae7fb643369ebd826eb948a9a18df1a8dd252ff8,1079 - simple-logger-0.1.0@sha256:be8ede4bd251a9cac776533bae7fb643369ebd826eb948a9a18df1a8dd252ff8,1079
# - terminal-0.2.0.0@sha256:de6770ecaae3197c66ac1f0db5a80cf5a5b1d3b64a66a05b50f442de5ad39570,2977 # - terminal-0.2.0.0@sha256:de6770ecaae3197c66ac1f0db5a80cf5a5b1d3b64a66a05b50f442de5ad39570,2977
- github: simplex-chat/haskell-terminal - github: simplex-chat/haskell-terminal
commit: 5e0759ce4f9655fd3f0d94c76225e6904630dfd3 commit: f708b00009b54890172068f168bf98508ffcd495
- simplexmq-1.0.0@sha256:34b2004728ae396e3ae449cd090ba7410781e2b3cefc59259915f4ca5daa9ea8,8561 - simplexmq-1.0.0@sha256:34b2004728ae396e3ae449cd090ba7410781e2b3cefc59259915f4ca5daa9ea8,8561
# - ../simplexmq # - ../simplexmq
# - github: simplex-chat/simplexmq # - github: simplex-chat/simplexmq