-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (84 loc) · 3.86 KB
/
install_prerequisites.yaml
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
name: Test install_prerequisites.py
on:
push:
pull_request:
jobs:
build:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-14]
env:
LLVM_VERSION: 19
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: cjdb/new_cxx_project.git
ref: main
submodules: recursive
- name: Get Docker
id: get_docker
if: matrix.os == 'ubuntu-24.04'
run: |
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo docker run hello-world
- name: Test apt
id: apt
if: matrix.os == 'ubuntu-24.04'
run:
sudo docker run --network=host -t -v $PWD:$HOME -w $HOME --rm ubuntu bash -c
'apt-get update &&
apt-get upgrade -y &&
echo 11 33 | apt-get install -y tzdata &&
ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime &&
dpkg-reconfigure -fnoninteractive tzdata &&
apt-get install -y software-properties-common sudo &&
apt-get install -y gcc g++ wget lsb-release python3-venv &&
yes | ./install_prerequisites.py &&
"${HOME}/.config/new_cxx_project/bin/python" new_cxx_project.py --author new_cxx_project --package-manager=vcpkg --remote=https://github.com/new_cxx_project/test.git /tmp/test &&
cmake -GNinja -S/tmp/test -B/tmp/build -DCMAKE_BUILD_TYPE=Debug &&
ninja -C /tmp/build'
- name: Test pacman
id: pacman
if: matrix.os == 'ubuntu-24.04'
run:
sudo docker run --network=host -t -v $PWD:$HOME -w $HOME --rm archlinux bash -c
'yes | pacman -Syu python3 sudo &&
yes | ./install_prerequisites.py &&
"${HOME}/.config/new_cxx_project/bin/python" new_cxx_project.py --author new_cxx_project --package-manager=vcpkg --remote=https://github.com/new_cxx_project/test.git /tmp/test &&
cmake -GNinja -S/tmp/test -B/tmp/build -DCMAKE_BUILD_TYPE=Debug &&
ninja -C /tmp/build'
- name: Test dnf
id: dnf
if: matrix.os == 'ubuntu-24.04'
run:
sudo docker run --network=host -t -v $PWD:$HOME -w $HOME --rm fedora bash -c
'yes | dnf update &&
yes | dnf install sudo &&
yes | ./install_prerequisites.py &&
"${HOME}/.config/new_cxx_project/bin/python" new_cxx_project.py --author new_cxx_project --package-manager=vcpkg --remote=https://github.com/new_cxx_project/test.git /tmp/test &&
cmake -GNinja -S/tmp/test -B/tmp/build -DCMAKE_BUILD_TYPE=Debug &&
ninja -C /tmp/build'
- name: Test Homebrew
id: homebrew
if: matrix.os == 'macos-14'
run: |
./install_prerequisites.py
"${HOME}/.config/new_cxx_project/bin/python" new_cxx_project.py --author new_cxx_project --package-manager=vcpkg --remote=https://github.com/new_cxx_project/test.git $HOME/test
cmake -GNinja -S $HOME/test -B $HOME/test/build -DCMAKE_BUILD_TYPE=Debug
ninja -C $HOME/test/build