aboutsummaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/test.yml
blob: b2669786ebcf6c299adb263abaca7a180b6f5cbc (plain) (blame)
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Test

on: [push, pull_request]

permissions:
  contents: read

jobs:

  test-posix:
    name: Build and test on POSIX systems
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ ubuntu-latest, macos-latest, macos-14, macos-15-intel ]
    steps:
      - name: Checkout the repository
        uses: actions/checkout@master
      - name: Compile the project
        run: make clean && make
      - name: Test the project
        run: make test

  test-windows:
    name: Build and test on Windows
    strategy:
      matrix:
        os: [ windows-latest, windows-2022 ]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout the repository
        uses: actions/checkout@master
      - name: Setup MSVC
        uses: ilammy/msvc-dev-cmd@v1
      - name: Build the project
        shell: cmd
        run: build_win
      - name: Test the project
        shell: cmd
        run: build_win test
      - name: Test installer build
        shell: cmd
        run: build_win dist

  test-windows-min:
    name: Build and test on Windows Minimal build
    strategy:
      matrix:
        os: [ windows-2022 ]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout the repository
        uses: actions/checkout@master
      - name: Setup MSVC
        uses: ilammy/msvc-dev-cmd@v1
      - name: Setup Python
        uses: actions/setup-python@v2
        with:
          python-version: '3.x'
      - name: Install Python Dependencies
        run: pip install meson ninja
      - name: Build
        shell: cmd
        run: |
          meson setup build_meson_min --buildtype=release -Dsingle_threaded=true -Dnanbox=false -Ddynamic_modules=false -Ddocstrings=false -Dnet=false -Dsourcemaps=false -Dpeg=false -Dassembler=false -Dint_types=false -Dreduced_os=true -Dffi=false
          cd build_meson_min
          ninja

  test-mingw:
    name: Build on Windows with Mingw
    runs-on: windows-latest
    defaults:
      run:
        shell: msys2 {0}
    strategy:
      matrix:
        msystem: [ UCRT64, CLANG64 ]
    steps:
      - name: Checkout the repository
        uses: actions/checkout@master
      - name: Setup Mingw
        uses: msys2/setup-msys2@v2
        with:
          msystem: ${{ matrix.msystem }}
          update: true
          install: >-
            base-devel
            git
            gcc
      - name: Build
        shell: cmd
        run: make -j4 CC=gcc
      - name: Test
        shell: cmd
        run: make -j4 CC=gcc test

  test-mingw-linux:
    name: Build and test with Mingw on Linux + Wine
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the repository
        uses: actions/checkout@master
      - name: Setup Mingw and wine
        run: |
          sudo dpkg --add-architecture i386
          sudo apt-get update
          sudo apt-get install libstdc++6:i386 libgcc-s1:i386
          sudo apt-get install gcc-mingw-w64-x86-64-win32 wine wine32 wine64
      - name: Compile the project
        run: make clean && make CC=x86_64-w64-mingw32-gcc LD=x86_64-w64-mingw32-gcc UNAME=MINGW RUN=wine
      - name: Test the project
        run: make test UNAME=MINGW RUN=wine VERBOSE=1

  test-arm-linux:
    name: Build and test ARM32 cross compilation
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the repository
        uses: actions/checkout@master
      - name: Setup qemu and cross compiler
        run: |
          sudo apt-get update
          sudo apt-get install gcc-arm-linux-gnueabi qemu-user
      - name: Compile the project
        run: make RUN="qemu-arm -L /usr/arm-linux-gnueabi/" CC=arm-linux-gnueabi-gcc LD=arm-linux-gnueabi-gcc
      - name: Test the project
        run: make RUN="qemu-arm -L /usr/arm-linux-gnueabi/" SUBRUN="qemu-arm -L /usr/arm-linux-gnueabi/" test VERBOSE=1

  test-s390x-linux:
    name: Build and test s390x in qemu
    runs-on: ubuntu-latest
    steps:
    - name: Checkout the repository
      uses: actions/checkout@master
    - name: Enable qemu
      run: docker run --privileged --rm tonistiigi/binfmt --install s390x
    - name: Build and run on emulated architecture
      run: docker run --rm -v .:/janet --platform linux/s390x alpine sh -c "apk update && apk add --no-interactive git build-base && cd /janet && make -j3 && make test"

  test-cosmo:
    name: Test build for Cosmo
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the repository
        uses: actions/checkout@master
      - name: create build folder
        run: |
          sudo mkdir -p /sc
          sudo chmod -R 0777 /sc
      - name: setup Cosmopolitan Libc
        run: bash ./.github/cosmo/setup
      - name: Set the version
        run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
      - name: Set the platform
        run: echo "platform=cosmo" >> $GITHUB_ENV
      - name: build Janet APE binary
        run: bash ./.github/cosmo/build