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+ - interp
20+ - neko
21+ - node
22+ - js
23+ - cpp
24+ - php
25+ - jvm
26+ - python
27+ - lua
28+
29+ steps :
30+ - name : Check out repo
31+ uses : actions/checkout@v2
32+
33+ - name : Get yarn cache directory path
34+ id : yarn-cache-dir-path
35+ run : echo "::set-output name=dir::$(yarn cache dir)"
36+
37+ - name : Cache Yarn
38+ uses : actions/cache@v1
39+ with :
40+ path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
41+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
42+ restore-keys : |
43+ ${{ runner.os }}-yarn-
44+
45+ - name : Cache Haxe
46+ uses : actions/cache@v1
47+ with :
48+ path : ${{ startsWith(runner.os, 'windows') && '%AppData%' || '~/haxe' }}
49+ key : ${{ runner.os }}-haxe
50+
51+ - name : Install Lix
52+ uses : lix-pm/setup-lix@master
53+
54+ - name : Install Haxe
55+ run : lix install haxe ${{ matrix.haxe-version }}
56+
57+ - name : Install Haxe Libraries
58+ run : lix download
59+
60+ - name : Run Test
61+ run : lix run travix ${{ matrix.target }}
62+
63+ release :
64+ runs-on : ubuntu-latest
65+ needs : test
66+ if : startsWith(github.ref, 'refs/tags/') # consider using the "release" event. see: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#release
67+
68+ steps :
69+ - name : Check out repo
70+ uses : actions/checkout@v2
71+
72+ - name : Get yarn cache directory path
73+ id : yarn-cache-dir-path
74+ run : echo "::set-output name=dir::$(yarn cache dir)"
75+
76+ - name : Cache Yarn
77+ uses : actions/cache@v1
78+ with :
79+ path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
80+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
81+ restore-keys : |
82+ ${{ runner.os }}-yarn-
83+
84+ - name : Cache Haxe
85+ uses : actions/cache@v1
86+ with :
87+ path : ${{ startsWith(runner.os, 'windows') && '%AppData%' || '~/haxe' }}
88+ key : ${{ runner.os }}-haxe
89+
90+ - name : Install Lix
91+ uses : lix-pm/setup-lix@master
92+
93+ - name : Install Haxe
94+ run : lix install haxe stable
95+
96+ - name : Install Haxe Libraries
97+ run : lix download
98+
99+ - name : Release to Haxelib
100+ run : lix run travix release
101+ env :
102+ HAXELIB_AUTH : ${{ secrets.HAXELIB_AUTH }}
103+
0 commit comments