Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dsce with a makefile #2

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Better caching
  • Loading branch information
dhinakg committed Aug 8, 2023
commit c460c03fe9ce9ad24e700a9f854434132e551553
32 changes: 24 additions & 8 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,38 @@ jobs:
# We do not want to check submodules
- uses: actions/checkout@v3

- name: Set permissions
run: chmod -R a+rwx /var/cache/apt/archives

- name: Get codename
run: |
source /etc/os-release
echo "UBUNTU_CODENAME=${UBUNTU_CODENAME}" >> $GITHUB_ENV

- name: Restore cache
uses: actions/cache@v3
with:
key: ${{ env.UBUNTU_CODENAME }}-apt-${{ env.LLVM_VERSION }}
path: |
/var/cache/apt/archives/**.deb
!/var/cache/apt/archives/partial
!/var/cache/apt/archives/lock
/etc/apt/trusted.gpg.d/apt.llvm.org.asc
/etc/apt/sources.list.d/llvm.list
/var/lib/apt/lists/**
!/var/lib/apt/lists/partial
!/var/lib/apt/lists/lock

- name: Add LLVM repo
run: |
if [[ ! -f /etc/apt/trusted.gpg.d/apt.llvm.org.asc ]]; then
# download GPG key once
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
fi
source /etc/os-release
echo "UBUNTU_CODENAME=${UBUNTU_CODENAME}" >> $GITHUB_ENV
sudo add-apt-repository "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-${{ env.LLVM_VERSION }} main"
echo "deb http://apt.llvm.org/${{ env.UBUNTU_CODENAME }}/ llvm-toolchain-${{ env.UBUNTU_CODENAME }}-${{ env.LLVM_VERSION}} main" | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update

- name: Install LLVM
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: clang-format-${{ env.LLVM_VERSION}} clang-tidy-${{ env.LLVM_VERSION }}
version: ${{ env.UBUNTU_CODENAME }}-${{ env.LLVM_VERSION }}
sudo apt-get install clang-format-${{ env.LLVM_VERSION}} clang-tidy-${{ env.LLVM_VERSION }}

- uses: cpp-linter/cpp-linter-action@v2
id: linter
Expand Down