Skip to content

Commit d73e6fc

Browse files
committed
switch to compiling on arch
1 parent 7e458c4 commit d73e6fc

2 files changed

Lines changed: 30 additions & 51 deletions

File tree

.github/workflows/cmake.yml

Lines changed: 29 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage.
2-
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml
3-
name: Build
1+
name: Build (Arch Linux)
42

53
on: [push, pull_request]
64

@@ -9,52 +7,33 @@ env:
97

108
jobs:
119
build-linux-gcc:
12-
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
13-
# You can convert this to a matrix build if you need cross-platform coverage.
14-
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
15-
name: Linux (GCC 10)
16-
runs-on: ubuntu-20.04
10+
name: Arch Linux (GCC Latest)
11+
runs-on: ubuntu-latest # Uses an Ubuntu runner with an Arch Linux container
12+
container: archlinux:latest # Runs the job inside an Arch Linux container
1713

1814
steps:
19-
- uses: actions/checkout@v4
20-
with:
21-
submodules: 'recursive'
22-
23-
- name: Install Dependencies
24-
run: |
25-
sudo tee --append /etc/apt/sources.list << EOF
26-
deb http://us.archive.ubuntu.com/ubuntu/ bionic universe
27-
EOF
28-
sudo apt -y update
29-
sudo apt -y install libncursesw5-dev g++-10
30-
31-
- name: Configure CMake
32-
shell: bash
33-
env:
34-
CC: gcc-10
35-
CXX: g++-10
36-
run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE -G Ninja
37-
38-
- name: Build
39-
shell: bash
40-
run: cmake --build . -j$(nproc)
41-
42-
# build-macos-clang:
43-
# name: MacOS (Clang)
44-
# runs-on: macos-latest
45-
# steps:
46-
# - uses: actions/checkout@v4
47-
# with:
48-
# submodules: 'recursive'
49-
50-
# - name: Install Dependencies
51-
# run: |
52-
# brew install ninja
53-
54-
# - name: Configure CMake
55-
# shell: bash
56-
# run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE -G Ninja
57-
58-
# - name: Build
59-
# shell: bash
60-
# run: cmake --build . -j$(sysctl -n hw.logicalcpu)
15+
- name: Install Dependencies
16+
run: |
17+
pacman -Sy --noconfirm base-devel cmake ninja gcc git ncurses
18+
19+
- name: Checkout Repository
20+
uses: actions/checkout@v4
21+
with:
22+
submodules: 'recursive'
23+
24+
- name: Configure CMake
25+
shell: bash
26+
env:
27+
CC: gcc
28+
CXX: g++
29+
run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE -G Ninja
30+
31+
- name: Build Project
32+
shell: bash
33+
run: cmake --build . -j$(nproc)
34+
35+
- name: Upload Executable
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: compiled-executable
39+
path: ./text-editor

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
mkdir build
22
cd build
33
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 .. -DCMAKE_BUILD_TYPE=Release
4-
make -j$(nproc)
4+
cmake --build . -j$(nproc)
55
cd ..

0 commit comments

Comments
 (0)