Skip to content

Commit

Permalink
cicd: tier1 platforms (#8)
Browse files Browse the repository at this point in the history
* feedback

* aranya-project

* action urls

* feedback

* syntax

* abandon conditionals

* rm if

* arm64

* Add missing runner for check

* Update actions

* Clean up setup

* Clean up setup further

* fix

* fix rustfmt

* resolve merge

* fixes

* fix makefile

* release-action

* token perms

* rm GH_DOTCOM_TOKEN

* write-all

* env var

* Update CODEOWNERS

---------

Co-authored-by: Jonathan Dygert <[email protected]>
  • Loading branch information
gknopf-aranya and jdygert-spok authored Jan 7, 2025
1 parent 5dd5567 commit 9285ab6
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 219 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @djohnson @elagergren @gknopf @jdygert
* @djohnson-spideroak @elagergren-spideroak @gknopf-aranya @jdygert-spok
67 changes: 5 additions & 62 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,71 +1,14 @@
name: "Setup build tools"
description: "Action for setting up build tools"

inputs:
gh-token:
description: "github.com Access Token"
required: true
ghe-token:
description: "git.spideroak-inc.com Access Token"
required: true
runner:
description: "OS being used (e.g., macos-latest)"
required: true

runs:
using: "composite"
steps:
# Our runners don't get wiped between runs :/
- name: nuke old .gitconfig
run: rm ~/.gitconfig || true
shell: bash

- name: Set up git
run: |
git config --global --replace-all url."https://${{ inputs.ghe-token }}@git.spideroak-inc.com/".insteadOf 'https://git.spideroak-inc.com/'
git config --global --replace-all url."https://${{ inputs.gh-token }}@github.com/".insteadOf 'https://github.com/'
echo "CARGO_NET_GIT_FETCH_WITH_CLI=true" >> $GITHUB_ENV
shell: bash

- name: Install Rust
working-directory: ${{ runner.temp }}
run: |
cat<<EOF>>rustup.sh.sha256
32a680a84cf76014915b3f8aa44e3e40731f3af92cd45eb0fcc6264fd257c428 rustup.sh
EOF
wget 'https://sh.rustup.rs' -O rustup.sh
shasum -c rustup.sh.sha256
chmod +x ./rustup.sh
./rustup.sh -y --default-toolchain none
source "$HOME/.cargo/env"
echo "${HOME}/.cargo/bin" >> $GITHUB_PATH
shell: bash

# Various runners have a 64-bit kernel with a 32-bit userspace.
# Setting rustup's default host to armv7 allows using the 32-bit executables.
- name: Set rustup's host
run: |
rustup set default-host armv7-unknown-linux-gnueabihf
rustup show active-toolchain
shell: bash
if: ${{ inputs.runner == 'self-hosted-linux-arm' }}

- name: cargo version
- name: Version info
shell: bash
run: |
file cargo
cargo --version --verbose
- name: glibc version
shell: bash
run: ldd --version
if: ${{ inputs.runner == 'self-hosted-linux-arm' }}

- name: compiler version
shell: bash
run: |
sudo apt-get install -y clang \
--no-install-recommends
ldd --version
clang --version
gcc --version
cmake --version
Expand All @@ -85,9 +28,9 @@ runs:
doxygen --version
- name: Install sccache
uses: spideroak-inc/sccache-action@main
uses: aranya-project/sccache-action@main
with:
version: "v0.7.7"
version: "v0.8.2"

- name: Configure sccache
run: |
Expand All @@ -97,5 +40,5 @@ runs:
shell: bash

- name: Install cargo-make
run: cargo install --version '0.37.11' --locked cargo-make
run: cargo install --version '0.37.23' --locked cargo-make
shell: bash
33 changes: 8 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ on:
workflow:
required: true
type: string
secrets:
CC_BUILD_TOKEN:
required: true
GH_DOTCOM_TOKEN:
required: true

env:
REV: ${{ github.run_id }}
Expand All @@ -29,22 +24,16 @@ jobs:
strategy:
matrix:
include:
- runner: "self-hosted-linux-arm"
artifact: "aranya-daemon-arm-unknown-linux-gnueabi"
- runner: "self-hosted-linux-arm64"
- runner: "ubuntu2404-arm64-4core"
artifact: "aranya-daemon-aarch64-unknown-linux-gnu"
- runner: "self-hosted-linux-amd64"
- runner: "ubuntu-latest"
artifact: "aranya-daemon-x86_64-unknown-linux-gnu"
name: build daemon ${{ matrix.artifact }}
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ./.github/actions/setup
with:
ghe-token: ${{ secrets.CC_BUILD_TOKEN }}
gh-token: ${{ secrets.GH_DOTCOM_TOKEN }}
runner: ${{ matrix.runner }}

- name: Build code
run: |
Expand All @@ -55,7 +44,7 @@ jobs:
run: cargo make git-unchanged

- name: Publish daemon
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: aranya-daemon.tar.gz
Expand All @@ -65,23 +54,17 @@ jobs:
strategy:
matrix:
include:
- runner: "self-hosted-linux-arm"
artifact: "aranya-client-capi-arm-unknown-linux-gnueabi"
- runner: "self-hosted-linux-arm64"
- runner: "ubuntu2404-arm64-4core"
artifact: "aranya-client-capi-aarch64-unknown-linux-gnu"
- runner: "self-hosted-linux-amd64"
- runner: "ubuntu-latest"
artifact: "aranya-client-capi-x86_64-unknown-linux-gnu"
name: build lib ${{ matrix.artifact }}
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Environment
uses: ./.github/actions/setup
with:
ghe-token: ${{ secrets.CC_BUILD_TOKEN }}
gh-token: ${{ secrets.GH_DOTCOM_TOKEN }}
runner: ${{ matrix.runner }}

- name: Build Aranya Shared Library
run: |
Expand All @@ -91,7 +74,7 @@ jobs:
cargo make git-unchanged
- name: Publish aranya lib
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: aranya-client-lib.tar.gz
Expand Down
42 changes: 9 additions & 33 deletions .github/workflows/correctness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ on:
workflow:
required: true
type: string
secrets:
CC_BUILD_TOKEN:
required: true
GH_DOTCOM_TOKEN:
required: true

env:
REV: ${{ github.run_id }}
Expand All @@ -26,43 +21,31 @@ concurrency:

jobs:
fmt:
runs-on: self-hosted-linux-amd64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ./.github/actions/setup
with:
ghe-token: ${{ secrets.CC_BUILD_TOKEN }}
gh-token: ${{ secrets.GH_DOTCOM_TOKEN }}
runner: self-hosted-linux-amd64

- name: Check formatting
run: cargo make check-fmt

clippy:
runs-on: self-hosted-linux-amd64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ./.github/actions/setup
with:
ghe-token: ${{ secrets.CC_BUILD_TOKEN }}
gh-token: ${{ secrets.GH_DOTCOM_TOKEN }}
runner: self-hosted-linux-amd64

- name: Run clippy
run: cargo make clippy

machete:
runs-on: self-hosted-linux-amd64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ./.github/actions/setup
with:
ghe-token: ${{ secrets.CC_BUILD_TOKEN }}
gh-token: ${{ secrets.GH_DOTCOM_TOKEN }}
runner: self-hosted-linux-amd64

- name: Check dependency usage
run: cargo make machete
Expand All @@ -71,21 +54,14 @@ jobs:
strategy:
matrix:
runner:
# TODO(eric): re-enable after we get macOS runners.
# - "macos-latest"
- "self-hosted-linux-arm"
- "self-hosted-linux-arm64"
- "self-hosted-linux-amd64"
- ubuntu-latest
- ubuntu2404-arm64-4core
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Environment
uses: ./.github/actions/setup
with:
ghe-token: ${{ secrets.CC_BUILD_TOKEN }}
gh-token: ${{ secrets.GH_DOTCOM_TOKEN }}
runner: ${{ matrix.runner }}

- name: Check Features
run: cargo make check-features
32 changes: 10 additions & 22 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ on:
workflow:
required: true
type: string
secrets:
CC_BUILD_TOKEN:
required: true
GH_DOTCOM_TOKEN:
required: true

env:
REV: ${{ github.run_id }}
Expand All @@ -26,44 +21,37 @@ concurrency:

jobs:
aranya-client-capi-docs:
runs-on: self-hosted-linux-amd64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ./.github/actions/setup
with:
ghe-token: ${{ secrets.CC_BUILD_TOKEN }}
gh-token: ${{ secrets.GH_DOTCOM_TOKEN }}
runner: self-hosted-linux-amd64

- name: Generate Doxygen docs
run: |
cargo make build-capi-docs
cargo make tgz-capi-docs
- name: Generate Doxygen docs
run: |
cargo make build-capi-docs
cargo make tgz-capi-docs
- name: Publish Doxygen docs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: aranya-client-capi-docs
path: aranya-client-capi-docs.tar.gz
if-no-files-found: error

aranya-rust-docs:
runs-on: self-hosted-linux-amd64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
ghe-token: ${{ secrets.CC_BUILD_TOKEN }}
gh-token: ${{ secrets.GH_DOTCOM_TOKEN }}
runner: self-hosted-linux-amd64

- name: Generate docs
env:
RUSTDOCFLAGS: "-Dwarnings"
run: |
if ! command -v zip; then
sudo apt-get install -y zip \
--no-install-recommends
fi
cargo make gen-docs-nightly
Loading

0 comments on commit 9285ab6

Please sign in to comment.