-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
3,572 additions
and
1,579 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
name: ci/gh-actions/guix | ||
|
||
on: [push, pull_request] | ||
|
||
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 | ||
jobs: | ||
cache-sources: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: depends sources cache | ||
id: cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: contrib/depends/sources | ||
key: sources-${{ hashFiles('contrib/depends/packages/*') }} | ||
- name: download depends sources | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: make -C contrib/depends download | ||
|
||
cache-guix: | ||
runs-on: ubuntu-latest | ||
needs: [cache-sources] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: guix cache | ||
id: cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
gnu/store | ||
guix_db.sqlite | ||
key: guix-${{ hashFiles('contrib/guix/manifest.scm') }} | ||
- name: move guix store | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
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 sources cache | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: contrib/depends/sources | ||
key: sources-${{ hashFiles('contrib/depends/packages/*') }} | ||
- name: set apt conf | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: ${{env.APT_SET_CONF}} | ||
- name: install dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: sudo apt update; sudo apt -y install guix git ca-certificates | ||
- name: dry run | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: DRY_RUN=1 SUBSTITUTE_URLS='http://ci.guix.gnu.org' JOBS=2 ./contrib/guix/guix-build | ||
- name: prepare guix store for caching | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
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] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
toolchain: | ||
- target: "x86_64-linux-gnu" | ||
- target: "aarch64-linux-gnu" | ||
- target: "arm-linux-gnueabihf" | ||
- target: "riscv64-linux-gnu" | ||
- target: "i686-linux-gnu" | ||
- target: "x86_64-w64-mingw32" | ||
- target: "i686-w64-mingw32" | ||
- target: "x86_64-apple-darwin" | ||
- target: "aarch64-apple-darwin" | ||
- target: "aarch64-linux-android" | ||
- target: "arm-linux-androideabi" | ||
|
||
name: ${{ matrix.toolchain.target }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
- name: remove bundled packages | ||
run: sudo rm -rf /usr/local | ||
- name: guix cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
gnu/store | ||
guix_db.sqlite | ||
key: guix-${{ hashFiles('contrib/guix/manifest.scm') }} | ||
- 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@v4 | ||
with: | ||
path: contrib/depends/built | ||
key: depends-${{ matrix.toolchain.target }}-${{ hashFiles('contrib/depends/packages/*') }} | ||
- name: depends sources cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: contrib/depends/sources | ||
key: sources-${{ hashFiles('contrib/depends/packages/*') }} | ||
- name: set apt conf | ||
run: ${{env.APT_SET_CONF}} | ||
- name: install dependencies | ||
run: sudo apt update; sudo apt -y install guix git ca-certificates | ||
- name: build | ||
run: SUBSTITUTE_URLS='http://ci.guix.gnu.org' HOSTS="${{ matrix.toolchain.target }}" JOBS=2 ./contrib/guix/guix-build | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.toolchain.target }} | ||
path: | | ||
guix/guix-build-*/output/${{ matrix.toolchain.target }}/* |
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
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
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
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
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
Oops, something went wrong.