-
-
Notifications
You must be signed in to change notification settings - Fork 116
75 lines (64 loc) · 1.97 KB
/
test-pkg.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
66
67
68
69
70
71
72
73
74
75
name: Test pkg binaries
on:
workflow_call:
inputs:
ref:
description: Git reference to checkout
type: string
required: false
jobs:
test-pkg:
name: Test pkg binary on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: linux
os: ubuntu-latest
- name: mac
os: macos-latest
- name: win
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout project
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
- name: Fetch pkg binary
uses: actions/download-artifact@v4
with:
name: grain-${{ matrix.name }}-x64
- name: Untar download
run: |
tar -xvf grain.tar
# This is to test the CLI is working
- name: Log Grain version
if: matrix.os != 'windows-latest'
run: |
./grain -v
- name: Log Grain version
if: matrix.os == 'windows-latest'
run: |
./grain.exe -v
# If we have a working grain CLI, we can run graindoc on stdlib
- name: (stdlib) Check documentation
if: matrix.os != 'windows-latest'
run: |
./grain doc stdlib -o stdlib --current-version=$(./grain -v)
git diff --exit-code --name-only
# If we have a working grain CLI, we can run grainfmt on stdlib & tests
- name: (stdlib) Check formatting
if: matrix.os != 'windows-latest'
run: |
./grain format stdlib -o stdlib
./grain format compiler/test/stdlib -o compiler/test/stdlib
git diff --exit-code --name-only
- name: Smoketest a program
if: matrix.os != 'windows-latest'
run: |
./grain compiler/test/input/relativeIncludeLinking.gr
- name: Smoketest a program
if: matrix.os == 'windows-latest'
run: |
./grain.exe compiler/test/input/relativeIncludeLinking.gr