Skip to content

Commit

Permalink
Adopt cache-apt-pkgs, add curl 8.9.1 build & unit-test to workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ChAoSUnItY committed Nov 28, 2024
1 parent 4b3f12c commit 3dcb97f
Showing 1 changed file with 44 additions and 5 deletions.
49 changes: 44 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Github Actions
on: [push, pull_request]

jobs:
host-x86:
host-x86-build:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -12,10 +12,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: Install prerequisite
run: |
sudo apt-get update -q -y
sudo apt-get install -q -y file
sudo apt-get install -q -y build-essential
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: file build-essential clang
version: 1.0
- name: Build stage 1 artifact
env:
CC: ${{ matrix.compiler }}
Expand All @@ -35,3 +35,42 @@ jobs:
run: |
make test-stage2 || exit 1
shell: bash
- run: mv slimcc slimcc-${{ matrix.compiler }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: slimcc-${{ matrix.compiler }}
path: slimcc-${{ matrix.compiler }}

test-building-real-world-projects:
needs: host-x86-build
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [gcc, clang]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: slimcc-${{ matrix.compiler }}
- run: |
chmod +x slimcc-${{ matrix.compiler }}
- uses: lukka/get-cmake@latest
with:
useLocalCache: true
- name: Install prerequisite
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: file build-essential clang libssh2-1
version: 1.0
- name: Test Building curl 8.9.1
run: |
git clone --depth 1 https://github.com/curl/curl --branch curl-8_9_1
mkdir curl/cmakebuild
cd curl/cmakebuild
cmake ../ -DCMAKE_C_COMPILER=${GITHUB_WORKSPACE}/slimcc-${{ matrix.compiler }} -DCMAKE_C_FLAGS=-fPIC
make -j
make test-quiet -j
shell: bash

0 comments on commit 3dcb97f

Please sign in to comment.