1+ name : CI
2+
3+ on :
4+ push :
5+ pull_request :
6+ branches : [ master ]
7+
8+ jobs :
9+ test :
10+
11+ runs-on : ubuntu-latest
12+
13+ strategy :
14+ matrix :
15+ haxe-version :
16+ - stable
17+ - nightly
18+ target :
19+ - node
20+
21+ steps :
22+ - name : Check out repo
23+ uses : actions/checkout@v2
24+
25+ - name : Get yarn cache directory path
26+ id : yarn-cache-dir-path
27+ run : echo "::set-output name=dir::$(yarn cache dir)"
28+
29+ - name : Cache Yarn
30+ uses : actions/cache@v1
31+ with :
32+ path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
33+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
34+ restore-keys : |
35+ ${{ runner.os }}-yarn-
36+
37+ - name : Cache Haxe
38+ uses : actions/cache@v1
39+ with :
40+ path : ${{ startsWith(runner.os, 'windows') && '%AppData%' || '~/haxe' }}
41+ key : ${{ runner.os }}-haxe
42+
43+ - name : Install Lix
44+ uses : lix-pm/setup-lix@master
45+
46+ - name : Install Haxe
47+ run : lix install haxe ${{ matrix.haxe-version }}
48+
49+ - name : Install Haxe Libraries
50+ run : lix download
51+
52+ - name : Run Test
53+ run : lix run travix ${{ matrix.target }}
54+
55+ release :
56+ runs-on : ubuntu-latest
57+ needs : test
58+ if : startsWith(github.ref, 'refs/tags/') # consider using the "release" event. see: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#release
59+
60+ steps :
61+ - name : Check out repo
62+ uses : actions/checkout@v2
63+
64+ - name : Get yarn cache directory path
65+ id : yarn-cache-dir-path
66+ run : echo "::set-output name=dir::$(yarn cache dir)"
67+
68+ - name : Cache Yarn
69+ uses : actions/cache@v1
70+ with :
71+ path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
72+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
73+ restore-keys : |
74+ ${{ runner.os }}-yarn-
75+
76+ - name : Cache Haxe
77+ uses : actions/cache@v1
78+ with :
79+ path : ${{ startsWith(runner.os, 'windows') && '%AppData%' || '~/haxe' }}
80+ key : ${{ runner.os }}-haxe
81+
82+ - name : Install Lix
83+ uses : lix-pm/setup-lix@master
84+
85+ - name : Install Haxe
86+ run : lix install haxe stable
87+
88+ - name : Install Haxe Libraries
89+ run : lix download
90+
91+ - name : Release to Haxelib
92+ run : lix run travix release
93+ env :
94+ HAXELIB_AUTH : ${{ secrets.HAXELIB_AUTH }}
95+
0 commit comments