don't fail fast. Clean up setting outputs

This commit is contained in:
Jared Weakly 2020-06-09 11:47:01 -07:00
parent 237730c0eb
commit d33a036cd0
4 changed files with 18 additions and 14 deletions

11
.github/ci.sh vendored
View File

@ -133,9 +133,14 @@ zip_dist() {
[[ -f "$name".zip.sig ]] && [[ -f "$name".zip ]]
}
set_outputs() {
echo "::set-output name=changed-files::$(git diff-tree --no-commit-id --name-only -r "$1" | xargs)"
echo "::set-output name=cryptol-version::$(grep Version cryptol.cabal | awk '{print $2}')"
output() { echo "::set-output name=$1::$2"; }
ver() { grep Version cryptol.cabal | awk '{print $2}'; }
set_version() { output cryptol-version "$(ver)"; }
set_files() { output changed-files "$(files_since "$1" "$2")"; }
files_since() {
changed_since="$(git log -1 --before="@{$2}")"
files="${changed_since:+"$(git diff-tree --no-commit-id --name-only -r "$1" | xargs)"}"
echo "$files"
}
COMMAND="$1"

View File

@ -15,11 +15,14 @@ jobs:
with:
fetch-depth: 0
- id: outputs
run: .github/ci.sh set_outputs ${{ github.sha }}
run: |
.github/ci.sh set_files ${{ github.sha }}
.github/ci.sh set_version
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
ghc: ["8.4.4", "8.6.5", "8.8.3"]

View File

@ -13,10 +13,8 @@ jobs:
fetch-depth: 0
- id: outputs
run: |
changed_since="$(git log --since '23 hours 59 minutes')"
files="${changed_since:+"$(git diff-tree --no-commit-id --name-only -r '${{ github.sha }}' | xargs)"}"
echo "::set-output name=files::$files"
echo "::set-output name=version::$(grep Version cryptol.cabal | awk '{print $2}')"
.github/ci.sh set_files '${{ github.sha }}' '23 hours 59 minutes'
.github/ci.sh set_version
- name: Publish to Registry
if: ${{ steps.outputs.outputs.files }}

View File

@ -11,17 +11,15 @@ jobs:
runs-on: ubuntu-latest
outputs:
cryptol-version: ${{ steps.cryptol.outputs.cryptol-version }}
cryptol-name: ${{ steps.cryptol.outputs.cryptol-name }}
cryptol-name: ${{ steps.cryptol.outputs.name }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- id: cryptol
run: |
ver="$(grep Version cryptol.cabal | awk '{print $2}')"
echo "::set-output name=cryptol-version::$ver"
d="$(date -I)"
echo "::set-output name=cryptol-name::cryptol-$ver-$d"
.github/ci.sh set_version
.github/ci.sh output name cryptol-$(.github/ci.sh ver)-$(date -I)
docs:
runs-on: ubuntu-latest
@ -53,7 +51,7 @@ jobs:
with:
submodules: true
- uses: actions/setup-haskell@v1.1
# - uses: actions/setup-haskell@v1.1
- uses: haskell-CI/setup@master
with:
ghc-version: "8.8"