Improve builds and fix release builds (#105)

* Checkout the PR branch if triggered by a PR

Signed-off-by: Sayan Nandan <nandansayan@outlook.com>

* Use `cmd` as the shell on Windows to fix builds

Signed-off-by: Sayan Nandan <nandansayan@outlook.com>

#104 did this for pushes; this will do it for releases.

* Fix Windows release script

Signed-off-by: Sayan Nandan <nandansayan@outlook.com>

* No need to checkout to head.ref for PRs

Signed-off-by: Sayan Nandan <nandansayan@outlook.com>
next
Sayan Nandan 4 years ago committed by GitHub
parent ce46e318f1
commit 5392f27fdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -89,7 +89,15 @@ jobs:
if: matrix.build == 'macos'
run: cargo build --release
- name: Install Perl (Windows)
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: "5.30"
distribution: strawberry
if: env.IS_MD_FILE == 'false' && runner.os == 'Windows'
- name: Build (Windows)
shell: cmd # Use cmd as the default shell to avoid perl path errors
if: matrix.build == 'windows'
run: cargo build --release
env:

@ -2,7 +2,7 @@ name: Test (PR)
on: [pull_request]
env:
BUILD: "false"
BUILD: false
jobs:
test:
name: Test
@ -69,7 +69,21 @@ jobs:
if: env.BUILD == 'true'
- name: Run Tests
run: cargo test --verbose -- --test-threads=1
run: cargo test --verbose
env:
RUST_BACKTRACE: 1
if: env.BUILD == 'true'
if: env.IS_MD_FILE == 'false' && runner.os != 'Windows'
- name: Install Perl (Windows)
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: "5.30"
distribution: strawberry
if: env.IS_MD_FILE == 'false' && runner.os == 'Windows'
- name: Run Tests (Windows)
run: cargo test --verbose
env:
RUST_BACKTRACE: 1
shell: cmd
if: env.IS_MD_FILE == 'false' && runner.os == 'Windows'

@ -2,6 +2,7 @@
# If source files were indeed modified, then this script sets `BUILD=true`
set -euo pipefail
SRC_CHANGED_COUNT=$(git diff --numstat HEAD^..HEAD -- '*.rs' '*.yml' '*.toml' 'Dockerfile' | wc -l)
if [ $SRC_CHANGED_COUNT != "0" ]; then

Loading…
Cancel
Save