|
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) |
4 | 2 |
|
5 | 3 | on: [push, pull_request] |
6 | 4 |
|
|
9 | 7 |
|
10 | 8 | jobs: |
11 | 9 | 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 |
17 | 13 |
|
18 | 14 | 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 |
0 commit comments