summaryrefslogtreecommitdiff
path: root/.github/workflows/build.yml
blob: 439005155f0fd0ac45de1d69c5c9ac8630157181 (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
name: CI

on: [push, pull_request]

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        include:
          - os: ubuntu-latest
            container: 'ubuntu:latest'
            artifact: 'ubuntu'

          - os: ubuntu-latest
            container: 'alpine:latest'
            artifact: 'alpine'

          - os: windows-latest
            artifact: 'windows'

          - os: macos-latest
            artifact: 'macos'

    container: ${{ matrix.container }}
    steps:
    - name: Install Ubuntu packages
      if: matrix.container == 'ubuntu:latest'
      run: |
        apt update
        apt -y install git make pbzip2 binutils bzip2 zstd gnupg

    - name: Install Alpine packages
      if: matrix.container == 'alpine:latest'
      run: apk add --no-cache bash git make libarchive-tools gnupg coreutils binutils bzip2 zstd

    - name: Install macOS packages
      if: runner.os == 'macOS'
      run: brew install pbzip2 coreutils zstd

    - name: Checkout Makeself
      uses: actions/checkout@v3
      with:
        submodules: 'true'

    - name: Build release
      run: make

    - uses: actions/upload-artifact@v3
      with:
        name: build-${{ matrix.artifact }}
        path: release
        
    - name: Run tests
      run: make test

  test-freebsd:
    needs: test
    runs-on: macos-10.15
    name: Test Makeself on FreeBSD
    steps:
      - uses: actions/checkout@v3
      - uses: actions/download-artifact@v3
      - name: Test on FreeBSD
        uses: vmactions/freebsd-vm@v0
        with:
          usesh: true
          prepare: pkg install -y pbzip2
          run: |
            pwd; freebsd-version
            sh ./test/run-makeself.sh

  test-solaris:
    needs: test
    runs-on: macos-10.15
    name: Test Makeself on Solaris
    steps:
      - uses: actions/checkout@v3
      - uses: actions/download-artifact@v3
      - name: Test on Solaris
        uses: vmactions/solaris-vm@v0
        with:
          mem: 2048
          prepare: pkgutil -y -i pbzip2
          run: |
            pwd
            sh ./test/run-makeself.sh

  test-alpine:
    needs: test
    name: Test Makeself on Alpine
    runs-on: ubuntu-latest
    container: alpine:latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/download-artifact@v3
      - name: Test on Alpine
        run: sh ./test/run-makeself.sh

  test-nanoserver:
    needs: test
    name: Test Makeself on Nanoserver
    runs-on: windows-2022
    env:
      IMAGE_NAME: mcr.microsoft.com/windows/nanoserver:ltsc2022-amd64

    steps:
      - uses: actions/checkout@v3
      - uses: actions/download-artifact@v3

      - name: pull windows container ${{ env.IMAGE_NAME }}
        shell: cmd
        run: |
          docker pull ${{ env.IMAGE_NAME }}
          docker images ${{ env.IMAGE_NAME }}

      - name: download tools
        shell: cmd
        run: curl --fail --silent --show-error --remote-name --location "https://frippery.org/files/busybox/busybox64.exe"

      - name: Test on Nanoserver
        shell: cmd
        run: docker container run --rm --env CI=true -v ${{ github.workspace }}:C:\app -w C:\app ${{ env.IMAGE_NAME }} C:\app\busybox64.exe sh ./test/run-makeself.sh

  lint:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout Makeself
      uses: actions/checkout@v2
    - name: Run ShellCheck
      uses: megastep/shell-linter@develop
      with:
        path: "makeself.sh"
        severity: "error"