feather/.github/workflows/guix.yml

149 lines
5.1 KiB
YAML
Raw Normal View History

2023-05-28 14:21:48 +00:00
name: ci/gh-actions/guix
2023-12-06 02:10:35 +00:00
on: [push, pull_request]
2023-05-28 14:21:48 +00:00
env:
APT_SET_CONF: |
echo "Acquire::Retries \"3\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
echo "Acquire::http::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
echo "Acquire::ftp::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
2023-05-31 11:02:39 +00:00
2023-05-28 14:21:48 +00:00
jobs:
2023-05-30 15:58:48 +00:00
cache-sources:
2023-05-28 14:21:48 +00:00
runs-on: ubuntu-latest
2023-05-30 15:58:48 +00:00
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: depends sources cache
2023-05-31 00:33:24 +00:00
id: cache
2023-05-30 15:58:48 +00:00
uses: actions/cache@v3
with:
path: contrib/depends/sources
key: sources-${{ hashFiles('contrib/depends/packages/*') }}
- name: download depends sources
2023-05-31 00:33:24 +00:00
if: steps.cache.outputs.cache-hit != 'true'
2023-05-30 15:58:48 +00:00
run: make -C contrib/depends download
2023-05-31 00:33:24 +00:00
cache-guix:
2023-05-30 15:58:48 +00:00
runs-on: ubuntu-latest
needs: [cache-sources]
2023-05-31 00:33:24 +00:00
steps:
2023-05-31 00:37:06 +00:00
- uses: actions/checkout@v3
with:
fetch-depth: 0
2023-05-31 00:33:24 +00:00
- name: guix cache
2023-05-31 13:12:42 +00:00
id: cache
2023-05-31 00:33:24 +00:00
uses: actions/cache@v3
with:
path: |
gnu/store
guix_db.sqlite
key: guix-${{ hashFiles('contrib/guix/manifest.scm') }}
- name: move guix store
2023-05-31 11:02:39 +00:00
if: steps.cache.outputs.cache-hit != 'true'
2023-05-31 00:33:24 +00:00
run: |
if [[ -e "guix_db.sqlite" ]]; then
sudo mkdir -p /var/guix/db
sudo mv gnu /gnu
sudo cp guix_db.sqlite /var/guix/db/db.sqlite
sudo chmod 1775 /gnu/store
sudo chown 0644 /var/guix/db/db.sqlite
sudo chown -R root:root /gnu/store /var/guix/db/db.sqlite
fi
2023-05-31 11:02:39 +00:00
- name: depends sources cache
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/cache/restore@v3
with:
path: contrib/depends/sources
key: sources-${{ hashFiles('contrib/depends/packages/*') }}
2023-05-31 00:33:24 +00:00
- name: set apt conf
2023-05-31 11:02:39 +00:00
if: steps.cache.outputs.cache-hit != 'true'
2023-05-31 00:33:24 +00:00
run: ${{env.APT_SET_CONF}}
- name: install dependencies
2023-05-31 11:02:39 +00:00
if: steps.cache.outputs.cache-hit != 'true'
2023-05-31 00:33:24 +00:00
run: sudo apt update; sudo apt -y install guix git ca-certificates
- name: dry run
2023-05-31 11:02:39 +00:00
if: steps.cache.outputs.cache-hit != 'true'
2023-05-31 00:33:24 +00:00
run: DRY_RUN=1 SUBSTITUTE_URLS='http://ci.guix.gnu.org' JOBS=2 ./contrib/guix/guix-build
- name: prepare guix store for caching
2023-05-31 11:02:39 +00:00
if: steps.cache.outputs.cache-hit != 'true'
2023-05-31 00:33:24 +00:00
run: |
sudo systemctl stop guix-daemon
sudo mv /gnu gnu
sudo mv /var/guix/db/db.sqlite guix_db.sqlite
build-guix:
runs-on: ubuntu-latest
needs: [cache-guix]
2023-05-28 14:21:48 +00:00
strategy:
fail-fast: false
matrix:
toolchain:
- name: "x86_64-linux-gnu"
host: "x86_64-linux-gnu"
- name: "x86_64-linux-gnu.no-tor-bundle"
host: "x86_64-linux-gnu.no-tor-bundle"
2023-06-28 15:30:29 +00:00
- name: "x86_64-linux-gnu.pack"
host: "x86_64-linux-gnu.pack"
2023-05-28 14:21:48 +00:00
- name: "aarch64-linux-gnu"
host: "aarch64-linux-gnu"
- name: "arm-linux-gnueabihf"
host: "arm-linux-gnueabihf"
- name: "riscv64-linux-gnu"
host: "riscv64-linux-gnu"
- name: "x86_64-w64-mingw32"
host: "x86_64-w64-mingw32"
- name: "x86_64-w64-mingw32.installer"
host: "x86_64-w64-mingw32.installer"
- name: "x86_64-apple-darwin"
host: "x86_64-apple-darwin"
- name: "arm64-apple-darwin"
host: "arm64-apple-darwin"
name: ${{ matrix.toolchain.name }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: guix cache
2023-05-31 00:33:24 +00:00
uses: actions/cache/restore@v3
2023-05-28 14:21:48 +00:00
with:
path: |
gnu/store
guix_db.sqlite
2023-05-31 00:33:24 +00:00
key: guix-${{ hashFiles('contrib/guix/manifest.scm') }}
2023-05-28 14:21:48 +00:00
- name: move guix store
run: |
if [[ -e "guix_db.sqlite" ]]; then
sudo mkdir -p /var/guix/db
sudo mv gnu /gnu
sudo cp guix_db.sqlite /var/guix/db/db.sqlite
sudo chmod 1775 /gnu/store
sudo chown 0644 /var/guix/db/db.sqlite
sudo chown -R root:root /gnu/store /var/guix/db/db.sqlite
fi
- name: depends cache
uses: actions/cache@v3
with:
path: contrib/depends/built
key: depends-${{ matrix.toolchain.host }}-${{ hashFiles('contrib/depends/packages/*') }}
- name: depends sources cache
2023-05-30 15:58:48 +00:00
uses: actions/cache/restore@v3
2023-05-28 14:21:48 +00:00
with:
path: contrib/depends/sources
2023-05-30 15:58:48 +00:00
key: sources-${{ hashFiles('contrib/depends/packages/*') }}
2023-05-28 14:21:48 +00:00
- name: set apt conf
run: ${{env.APT_SET_CONF}}
- name: install dependencies
2023-05-31 00:33:24 +00:00
run: sudo apt update; sudo apt -y install guix git ca-certificates
2023-05-28 14:21:48 +00:00
- name: build
run: SUBSTITUTE_URLS='http://ci.guix.gnu.org' HOSTS="${{ matrix.toolchain.host }}" JOBS=2 ./contrib/guix/guix-build
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.toolchain.name }}
path: |
guix/guix-build-*/output/${{ matrix.toolchain.host }}/*