aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/push.yml
blob: f8004d9ed0fe72ff618aa025468816c9f1f408e7 (plain)
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
158
159
160
161
162
163
164
165
166
167
168
169
name: 'push'

on:
  push:
  pull_request:

env:
  CI: true

jobs:

#
# GPL
#

  gpl:
    runs-on: ubuntu-latest
    steps:

    - uses: actions/checkout@v2

    - run: |
        TASK=buster+mcode ./dist/ci-run.sh -c --gpl --no-synth

#
# GNU/Linux
#

  lin:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      max-parallel: 3
      matrix:
        task: [
          { backend: mcode, version: '' },
          { backend: llvm,  version: '-5.0' },
          { backend: gcc,   version: '-8.3.0' }
        ]
    steps:

    - uses: actions/checkout@v2

    - name: Build and test GHDL in containers
      run: |
        TASK=ubuntu18+${{ matrix.task.backend }}${{ matrix.task.version }} ./dist/ci-run.sh -c
        mv ghdl-*-ubuntu18-*.tgz ghdl-gha-ubuntu-${{ matrix.task.backend }}.tgz

    - uses: actions/upload-artifact@v2
      with:
        path: ghdl-gha-ubuntu-*.tgz

#
# MacOS
#

  osx:
    runs-on: macOS-latest
    steps:

    - uses: actions/checkout@v2

    - run: |
        brew update
        brew install p7zip
        ./dist/macosx/install-ada.sh

    - name: Build and test GHDL
      run: |
        PATH=$PWD/gnat/bin:$PATH
        ./dist/ci-run.sh -c
      env:
        TASK: macosx+mcode
        GITHUB_OS: ${{ runner.os }}

#
# Windows
#

  win:
    runs-on: windows-latest
    strategy:
      fail-fast: false
      max-parallel: 2
      matrix:
        task: [
          {installs: "MINGW32", pkg: "mcode"},
          #{installs: "MINGW32", pkg: "llvm"},  ! Not yet functional
          #{installs: "MINGW64", pkg: "mcode"}, ! mcode is not yet supported on win64
          {installs: "MINGW64", pkg: "llvm"},
        ]
    env:
      MINGW_INSTALLS: ${{ matrix.task.installs }}
      TARGET: ${{ matrix.task.pkg }}
    defaults:
      run:
        shell: msys2 {0}
    steps:

    - uses: msys2/setup-msys2@v2
      with:
        msystem: MSYS
        update: true
        install: base-devel git

    - run: git config --global core.autocrlf input
      shell: bash

    - uses: actions/checkout@v2

    - name: Build and (hopefully) install package
      run: |
        ./dist/msys2-mingw/run.sh -b
        cp ./dist/msys2-mingw/${{ matrix.task.pkg }}/mingw-*ghdl*.pkg.tar.zst ghdl-gha-${{ matrix.installs }}-${{ matrix.task }}.zst

    - uses: actions/upload-artifact@v2
      with:
        name: ${{ matrix.task.installs }}-${{ matrix.task.pkg }}-builddir
        path: |
          ./dist/msys2-mingw/${{ matrix.task.pkg }}/src/
          ./dist/msys2-mingw/${{ matrix.task.pkg }}/pkg/

    - uses: actions/upload-artifact@v2
      with:
        path: ./dist/msys2-mingw/${{ matrix.task.pkg }}/mingw-*ghdl*.pkg.tar.zst

    - name: Test package
      run: |
        env | grep MSYSTEM
        env | grep MINGW
        GHDL=ghdl ./testsuite/testsuite.sh
      env:
        MSYSTEM: ${{ matrix.task.installs }}

#
# NIGHTLY
#

  nightly:
    if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
    needs: [ lin, win ]
    runs-on: ubuntu-latest
    steps:

    - uses: actions/download-artifact@v2

    - uses: eine/tip@master
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        tag: 'nightly'
        files: artifact/*

    - run: |
        curl -X POST https://api.github.com/repos/ghdl/docker/dispatches \
        -H "Content-Type: application/json" \
        -H 'Accept: application/vnd.github.everest-preview+json' \
        -H "Authorization: token ${{ secrets.GHDL_BOT }}" \
        --data '{"event_type": "ghdl"}'

#---

# TODO:
# - Cache
#  - 'gnat' directory in macOS job
#
# - Re-package a MINGW/MSYS2 package to provide a 'standalone' tarball/zipfile.
#  - https://github.com/ghdl/ghdl/issues/318#issuecomment-286246287
#
# - Add GNAT GPL 32-bit build job with mcode backend