-
Notifications
You must be signed in to change notification settings - Fork 3
65 lines (61 loc) · 1.77 KB
/
main.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
name: ci
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
arch: [amd64, arm64, armhf]
target: [lib, exe, daemon, deb]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.sccache-${{ matrix.arch }}
key: ${{ runner.os }}-${{ matrix.arch }}-${{ matrix.target }}-sccache
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build
run: make TARGET=${{ matrix.arch }} ${{ matrix.target }}
- name: Fix cache permission
run: sudo chown -R $USER .sccache-${{ matrix.arch }}
- uses: actions/upload-artifact@v4
if: matrix.target == 'deb'
with:
name: sectora-${{ matrix.arch }}
path: ${{ github.workspace }}/target/*/debian/*.deb
set-dists:
runs-on: ubuntu-latest
outputs:
dists: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: |
content=$(curl -L https://raw.githubusercontent.com/yasuyuky/docker-ssh-test/main/dist.json | jq -c .)
echo matrix=${content} >>$GITHUB_OUTPUT
echo ${content}
test:
needs: [build, set-dists]
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson(needs.set-dists.outputs.dists) }}
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: sectora-amd64
path: target
- name: Run tests
run: make test-deb-stub dist=${{ matrix.dist }} ver=${{ matrix.ver }}
working-directory: test
env:
TERM: xterm-256color