-
-
Notifications
You must be signed in to change notification settings - Fork 248
63 lines (60 loc) · 1.64 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
---
name: "Build & Test MacPorts Base"
on:
- push
- pull_request
jobs:
build:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-13, macos-14, macos-15, ubuntu-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 64
- name: Cleanup /usr/local
if: startsWith(matrix.os,'macos')
run: |
sudo mkdir /opt/local.old
sudo mv /usr/local/* /opt/local.old
- name: Select Xcode version
if: startsWith(matrix.os,'macos')
run: |
case "`uname -r`" in
22.*) sudo xcode-select --switch /Applications/Xcode_14.3.1.app/Contents/Developer
;;
23.*) sudo xcode-select --switch /Applications/Xcode_15.4.app/Contents/Developer
;;
esac
- name: Install Linux Dependencies
if: startsWith(matrix.os,'ubuntu')
run: >
sudo apt update &&
sudo apt install mtree-netbsd
libcurl4-openssl-dev
- name: Configure MacPorts Base
run: |
set -eu
./standard_configure.sh
- name: Build MacPorts Base
run: |
set -eu
platform=$(uname -s)
case ${platform} in
Darwin) make -j$(sysctl -n hw.activecpu)
;;
Linux) make -j$(nproc)
;;
esac
- name: Install MacPorts Base
run: |
set -eu
sudo make install
- name: Test MacPorts Base
if: startsWith(matrix.os,'macos')
run: |
set -eu
make test