fix ci cross-compilation by compiling libpulse ourselves #133
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: [ "next" ] | |
pull_request: | |
branches: [ "master", "next" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
verify: | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
# NOTE: disabled for now, since cross' images are based on ubuntu:20.04 whose version of | |
# libpulse-dev is too old (it's 13, we need at least 14) | |
# - os: ubuntu-latest | |
# target: aarch64-unknown-linux-gnu | |
name: Build & Test | |
runs-on: ubuntu-latest | |
steps: | |
# git checkout | |
- uses: actions/checkout@v3 | |
# install just | |
- uses: extractions/setup-just@v1 | |
# setup rust toolchain | |
# https://github.com/actions-rs/toolchain/issues/126#issuecomment-782989659 | |
- run: rustup show && rustup target add ${{ matrix.target }} | |
# cache | |
- uses: actions/cache@v3 | |
with: | |
path: scripts/node/node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
~/.cargo/.crates.toml | |
~/.cargo/.crates2.json | |
target/ | |
key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }} | |
# install dependencies | |
- run: cargo install cross --git https://github.com/cross-rs/cross | |
# verify | |
- run: cross build --all --all-features --target ${{ matrix.target }} | |
- run: DEBUG=1 just test | |
release-aur-git: | |
name: Update AUR(i3stat-git) | |
needs: ['verify'] | |
runs-on: ubuntu-latest | |
# this should only run on pushes to `next`, not pull requests to it | |
if: github.event_name == 'push' | |
steps: | |
- uses: extractions/setup-just@v1 | |
- name: Setup SSH | |
run: | | |
eval "$(ssh-agent -s)" | |
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV | |
echo "SSH_AGENT_PID=$SSH_AGENT_PID" >> $GITHUB_ENV | |
ssh-add - <<< "${{ secrets.AUR_SSH_KEY }}" | |
mkdir -p $HOME/.ssh/ | |
echo "${{ vars.SSH_KNOWN_HOSTS }}" >> $HOME/.ssh/known_hosts | |
chmod 0600 $HOME/.ssh/* | |
- run: | | |
git clone ssh://[email protected]/i3stat-git.git aur && cd "$_" && git checkout master | |
sudo chown -R 1000:1000 "$PWD" | |
docker run \ | |
--rm \ | |
-v "$PWD:/pkg" \ | |
--env "GIT_AUTHOR_NAME=acheronfail" \ | |
--env "GIT_COMMITTER_NAME=acheronfail" \ | |
--env "[email protected]" \ | |
--env "[email protected]" \ | |
acheronfail/makepkg just update | |
sudo chown -R $USER:$USER "$PWD" | |
git push |