Skip to content

Commit 6258ac6

Browse files
authored
Move CI to GitHub Actions, upgrade to GHC 8.6.5 and Dhall 1.36 (#695)
1 parent 3309afd commit 6258ac6

25 files changed

+492
-613
lines changed

.github/workflows/build.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ ubuntu-latest, macOS-latest, windows-latest ]
15+
steps:
16+
# We set LF endings so that the Windows environment is consistent with Appveyor
17+
# See here for context: https://github.com/actions/checkout/issues/135
18+
- name: Set git to use LF
19+
run: |
20+
git config --global core.autocrlf false
21+
git config --global core.eol lf
22+
- uses: actions/checkout@v2
23+
- name: Setup Haskell
24+
uses: actions/[email protected]
25+
with:
26+
ghc-version: '8.6.5'
27+
stack-version: 'latest'
28+
enable-stack: true
29+
stack-no-global: true
30+
stack-setup-ghc: true
31+
- name: Setup node and npm
32+
uses: "actions/setup-node@v1"
33+
with:
34+
node-version: '10'
35+
# NB: We install gnu-tar because BSD tar is buggy on Github's macos machines,
36+
# and it breaks the cache: https://github.com/actions/cache/issues/403
37+
- name: Install GNU tar (macOS)
38+
if: runner.os == 'macOS'
39+
run: |
40+
brew install gnu-tar
41+
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
42+
- name: create ~/.local/bin
43+
run: mkdir -p "$HOME/.local/bin"
44+
- name: Add ~/.local/bin to PATH
45+
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
46+
- uses: actions/cache@v2
47+
with:
48+
path: |
49+
~/.stack
50+
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }}-1
51+
52+
53+
- name: Install dependencies
54+
run: |
55+
stack install --dependencies-only
56+
shell: bash
57+
58+
- name: Build
59+
run: stack build
60+
shell: bash
61+
62+
- name: Install
63+
run: stack install
64+
shell: bash
65+
66+
- name: Run tests
67+
run: stack test
68+
shell: bash

.github/workflows/release.yml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
draft_release:
10+
name: Create draft release
11+
runs-on: ubuntu-latest
12+
outputs:
13+
upload_url: ${{ steps.create_release.outputs.upload_url }}
14+
15+
steps:
16+
- name: Create Release
17+
id: create_release
18+
uses: actions/create-release@v1
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
with:
22+
tag_name: ${{ github.ref }}
23+
release_name: ${{ github.ref }}
24+
body: ""
25+
draft: true
26+
prerelease: false
27+
28+
build_release:
29+
name: Build/upload release
30+
needs: draft_release
31+
runs-on: ${{ matrix.os }}
32+
strategy:
33+
matrix:
34+
os: [ ubuntu-latest, macOS-latest, windows-latest ]
35+
steps:
36+
- name: Set git to use LF
37+
run: |
38+
git config --global core.autocrlf false
39+
git config --global core.eol lf
40+
- uses: actions/checkout@v2
41+
- name: Setup Haskell
42+
uses: actions/[email protected]
43+
with:
44+
ghc-version: '8.6.5'
45+
stack-version: 'latest'
46+
enable-stack: true
47+
stack-no-global: true
48+
stack-setup-ghc: true
49+
- name: Setup node
50+
uses: actions/setup-node@v1
51+
with:
52+
node-version: 10
53+
# NB: We install gnu-tar because BSD tar is buggy on Github's macos machines,
54+
# and it breaks the cache: https://github.com/actions/cache/issues/403
55+
- name: Install GNU tar (macOS)
56+
if: runner.os == 'macOS'
57+
run: |
58+
brew install gnu-tar
59+
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
60+
61+
- name: Package binary (Linux and macOS)
62+
if: runner.os != 'Windows'
63+
shell: bash
64+
run: |
65+
stack install --dependencies-only
66+
mkdir artifacts
67+
stack build --copy-bins --local-bin-path ./artifacts
68+
cp artifacts/spago spago
69+
strip spago
70+
tar -zcvf "${{ matrix.os }}.tar.gz" spago
71+
72+
- name: Package binary (Windows)
73+
if: runner.os == 'Windows'
74+
shell: bash
75+
run: |
76+
stack install --dependencies-only
77+
stack build --copy-bins --local-bin-path ./artifacts
78+
cp artifacts/spago.exe spago.exe
79+
tar -zcvf windows.tar.gz spago.exe
80+
81+
- name: Upload Release Asset
82+
id: upload-release-asset
83+
uses: actions/upload-release-asset@v1
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
with:
87+
upload_url: ${{ needs.draft_release.outputs.upload_url }}
88+
asset_path: ./${{ matrix.os }}.tar.gz
89+
asset_name: ${{ matrix.os }}.tar.gz
90+
asset_content_type: application/gzip
91+
92+
npm_publish:
93+
name: Publish package on npm
94+
needs: build_release
95+
runs-on: ubuntu-latest
96+
steps:
97+
- uses: actions/checkout@v2
98+
- uses: actions/setup-node@v1
99+
with:
100+
node-version: 10
101+
- name: Prepare publish
102+
shell: bash
103+
run: |
104+
sed -e "s/NPM_VERSION/$(./scripts/get-version)/g" -i npm/package.json
105+
sed -e "s/PACKAGE_VERSION/$(./scripts/get-version)/g" -i npm/install.js
106+
cd npm
107+
cp ../README.md ./README.md
108+
cp ../CONTRIBUTING.md ./CONTRIBUTING.md
109+
cp ../LICENSE ./LICENSE
110+
- name: Publish to NPM
111+
uses: pascalgn/[email protected]
112+
with:
113+
workspace: "npm"
114+
publish_args: "--non-interactive"
115+
env:
116+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117+
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
data
22
test/spago-test
33
.stack-work/
4-
*.cabal
54
*~
65
**/__pycache__
76
templates/docs-search-app.js
87
templates/purescript-docs-search
98
.envrc
109
curator.log
1110
.DS_Store
11+
stack.yaml.lock

.mergify.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 166 deletions
This file was deleted.

0 commit comments

Comments
 (0)