File: Test.yml

package info (click to toggle)
openfpgaloader 0.13.1-1.1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 34,320 kB
  • sloc: cpp: 23,693; python: 555; makefile: 64; tcl: 62; xml: 41
file content (206 lines) | stat: -rw-r--r-- 4,851 bytes parent folder | download | duplicates (2)
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
name: Test

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:


  doc:
    runs-on: ubuntu-latest
    name: '๐Ÿ““ Docs'
    steps:

    - name: '๐Ÿงฐ Checkout'
      uses: actions/checkout@v4

    - name: '๐Ÿ““ BuildTheDocs (BTD)'
      uses: buildthedocs/btd@v0
      with:
        token: ${{ github.token }}
        skip-deploy: ${{ github.event_name == 'pull_request' }}

    - name: '๐Ÿงน Clean HTML build'
      if: ${{ github.event_name != 'pull_request' }}
      run: sudo rm -rf doc/_build/html/.git

    - name: '๐Ÿ“ค Upload artifact: HTML'
      uses: actions/upload-artifact@v4
      with:
        name: openFPGALoader-Documentation
        path: doc/_build/html


  lin-build:
    strategy:
      fail-fast: false
      matrix:
        os:
        - 20
        - 22
    name: '๐Ÿšง๐Ÿง Ubuntu ${{ matrix.os }} | build'
    runs-on: ubuntu-${{ matrix.os }}.04
    steps:

    - name: '๐Ÿงฐ Checkout'
      uses: actions/checkout@v4

    - name: 'โš™๏ธ Install dependencies'
      run: |
        sudo apt update -qq
        sudo apt install -y \
          cmake \
          gzip \
          libftdi1-2 \
          libftdi1-dev \
          libhidapi-libusb0 \
          libhidapi-dev \
          libudev-dev \
          pkg-config \
          tree \
          zlib1g-dev

    - name: '๐Ÿšง Build tarball'
      run: |
        mkdir build
        cd build
        cmake ..
        cmake --build .

        make DESTDIR=$(pwd)/dist install
        _rulesdir='dist/etc/udev/rules.d/'
        mkdir -p "${_rulesdir}"
        cp ../99-openfpgaloader.rules "${_rulesdir}"
        _licenses="dist/usr/local/share/licenses/openFPGALoader"
        mkdir -p "${_licenses}"
        install -m 644 ../LICENSE "${_licenses}"

        tar -cvzf ../ubtuntu${{ matrix.os }}.04-openFPGALoader.tgz -C dist .

    - name: '๐Ÿ“ค Upload artifact: tarball'
      uses: actions/upload-artifact@v4
      with:
        name: ubtuntu${{ matrix.os }}.04-openFPGALoader
        path: ubtuntu${{ matrix.os }}.04-openFPGALoader.tgz

    - name: '๐Ÿ” Show package content'
      run: |
        mkdir tmp
        cd tmp
        tar -xf ../ubtuntu${{ matrix.os }}.04-openFPGALoader.tgz
        tree .


  mac-build:
    strategy:
      fail-fast: false
    name: '๐Ÿšง๐Ÿง macOS latest | build'
    runs-on: macos-latest
    steps:

    - name: '๐Ÿงฐ Checkout'
      uses: actions/checkout@v4

    - name: 'โš™๏ธ Install dependencies'
      run: |
        #brew update
        brew install --only-dependencies openFPGALoader

    - name: '๐Ÿšง Build tarball'
      run: |
        mkdir build
        cd build
        cmake ..
        cmake --build .


  lin-test:
    needs: lin-build
    strategy:
      fail-fast: false
      matrix:
        os:
        - 20
        - 22
    name: '๐Ÿšฆ๐Ÿง Ubuntu ${{ matrix.os }} | test'
    runs-on: ubuntu-${{ matrix.os }}.04
    steps:

    - name: 'โš™๏ธ Install dependencies'
      run: |
        sudo apt update -qq
        sudo apt install -y \
          libftdi1-2 \
          libhidapi-libusb0 \
          udev \
          zlib1g

    - name: '๐Ÿ“ฅ Download artifact: package'
      uses: actions/download-artifact@v4.1.7
      with:
        name: ubtuntu${{ matrix.os }}.04-openFPGALoader

    - name: '๐Ÿ› ๏ธ Install package'
      run: sudo tar -xvzf *.tgz -C /

    - name: '๐Ÿšฆ Test package'
      run: |
        openFPGALoader --help
        openFPGALoader --detect || true


  win-jobs:
    name: โฌœ Generate list of MSYS2 jobs
    runs-on: ubuntu-latest
    outputs:
      jobs: ${{ steps.matrix.outputs.jobs }}
    steps:
    - id: matrix
      uses: msys2/setup-msys2/matrix@main
      with:
        systems: >-
          mingw64
          ucrt64
          clang64

  win:
    needs: win-jobs
    uses: msys2/setup-msys2/.github/workflows/PKGBUILD.yml@main
    with:
      name: openFPGALoader
      matrix: ${{ needs.win-jobs.outputs.jobs }}
      path: scripts/msys2
      test: |
        uname -a
        which openFPGALoader
        openFPGALoader --help
        openFPGALoader --detect || true


  Release:
    if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || contains(github.ref, 'refs/tags/'))
    needs: [ lin-test, win ]
    runs-on: ubuntu-latest
    name: '๐Ÿ“ฆ Release'
    steps:

    - name: '๐Ÿ“ฅ Download artifacts'
      uses: actions/download-artifact@v4.1.7
      with:
        path: artifact

    - name: 'โœ‰๏ธ Package Documentation'
      run: |
        cd artifact
        tar cvzf openFPGALoader-Documentation.tar.gz openFPGALoader-Documentation
        rm -rf openFPGALoader-Documentation

    # Tagged: create a pre-release or a release (semver)
    # Untagged: update the assets of pre-release 'nightly'
    - uses: pyTooling/Actions/releaser@r0
      with:
        token: ${{ github.token }}
        tag: 'nightly'
        files: artifact/**/*