git.iko.soy/rowtype-yoga/purescript-backend-optimizer
on main help sign in
Add GH Actions as CI (#11)

* Add GH Actions as CI * Setup CI w/o using setup-purescript GH action * Fail CI if there are warnings * Format non-snapshot files in test dir * Use correct binary * Fix formatting error * Drop windows build due to unknown formatting issue * Update .github/workflows/ci.yml Co-authored-by: Nathan Faubion <natefaubion@users.noreply.github.com> * Use Node 16 Co-authored-by: Nathan Faubion <natefaubion@users.noreply.github.com>

commit67b331aa5055c92a924ee95330cd2d454a380d2d authorJordan Martinez <jordan.martinez@arista.com> dateMon 15 Aug 2022, 12:12 (4 years ago) parent20d6774
1 file changed+57
.github/workflows/ci.yml+57
.github/workflows/ci.ymlnew file+57
@@ -0,0 +1,57 @@
1+name: CI
2+
3+on:
4+ push:
5+ branches: [main]
6+ pull_request:
7+ branches: [main]
8+
9+jobs:
10+ build:
11+ strategy:
12+ matrix:
13+ os: [ubuntu-latest, macOS-latest]
14+ runs-on: ${{ matrix.os }}
15+
16+ steps:
17+ - uses: actions/checkout@v2
18+
19+ - name: Set up Node toolchain
20+ uses: actions/setup-node@v2
21+ with:
22+ node-version: "16"
23+
24+ - name: Cache NPM dependencies
25+ uses: actions/cache@v2
26+ env:
27+ cache-name: cache-node-modules
28+ with:
29+ path: ~/.npm
30+ key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
31+ restore-keys: |
32+ ${{ runner.os }}-build-${{ env.cache-name }}-
33+ ${{ runner.os }}-build-
34+ ${{ runner.os }}-
35+
36+ - name: Setup PureScript dependencies
37+ run: npm i --global purescript@0.15.4 purs-tidy@latest spago@latest purescript-psa@latest
38+
39+ - name: Cache PureScript dependencies
40+ uses: actions/cache@v2
41+ with:
42+ key: ${{ runner.os }}-spago-${{ hashFiles('**/*.dhall') }}
43+ path: |
44+ .spago
45+ output
46+
47+ - name: Install dependencies
48+ run: spago install
49+
50+ - name: Build project
51+ run: spago build --purs-args '--censor-lib'
52+
53+ - name: Run snapshots
54+ run: spago test --purs-args '--censor-lib'
55+
56+ - name: Check formatting
57+ run: purs-tidy check src backend-es/src backend-es/test/*.purs