-
Notifications
You must be signed in to change notification settings - Fork 24
65 lines (58 loc) · 2.31 KB
/
check-xfail.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Check xfail
on:
pull_request:
jobs:
xfail:
runs-on: ubuntu-latest
strategy:
matrix:
julia-version: ['^1']
fail-fast: false
name: Test xfail Julia ${{ matrix.julia-version }}
steps:
- uses: actions/checkout@v2
- name: Try to merge xfail branch
run: |
git_fetch_branch() {
refspec="refs/heads/$1:refs/remotes/origin/$1"
git fetch --unshallow origin "$refspec" || git fetch origin "$refspec"
}
set -ex
xfailbranch=xfail/"${GITHUB_HEAD_REF#refs/heads/}"
if git_fetch_branch "$xfailbranch"
then
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
git config --global user.name "$GITHUB_ACTOR"
git merge "origin/$xfailbranch"
else
echo "No branch named $xfailbranch"
fi
# Note: `$GITHUB_REF` contains something like "refs/pull/26/merge".
# It seems `$GITHUB_HEAD_REF` contains the correct branch name.
# See also GitHub context `github.head_ref`:
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#github-context
- run: git log --graph --oneline -n10
- run: git show --no-patch --format='format:%H %T'
- run: echo $GITHUB_SHA
- run: git diff $GITHUB_SHA
- name: Check if xfail test is required
id: check-xfail-needed
run: |
xfailbranch=xfail/"${GITHUB_HEAD_REF#refs/heads/}"
if git rev-parse "refs/remotes/origin/$xfailbranch" -- > /dev/null
then
echo "::set-output name=need_xfail::yes"
else
echo "::set-output name=need_xfail::no"
fi
- name: Setup julia
if: ${{ steps.check-xfail-needed.outputs.need_xfail == 'yes' }}
uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.julia-version }}
- run: julia -e 'using Pkg; pkg"add Run@0.1"'
if: ${{ steps.check-xfail-needed.outputs.need_xfail == 'yes' }}
- run: julia -e 'using Run; Run.test(project = "test/environments/main", xfail = true)'
if: ${{ steps.check-xfail-needed.outputs.need_xfail == 'yes' }}
env:
JULIA_NUM_THREADS: '2'