Compare commits
No commits in common. "ad6d0ee55febef84ab44ab7740267c490f5db7dd" and "045983d7f419aff089e81f0e7c770dcf84f4a2eb" have entirely different histories.
ad6d0ee55f
...
045983d7f4
50
.gitea/workflows/build.yml
Normal file
50
.gitea/workflows/build.yml
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
- push
|
||||||
|
- pull_request
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
dist:
|
||||||
|
name: Create distribution
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
|
|
||||||
|
- name: Install Nix
|
||||||
|
uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30
|
||||||
|
with:
|
||||||
|
# explicitly enable sandbox
|
||||||
|
install_options: --daemon
|
||||||
|
extra_nix_config: |
|
||||||
|
sandbox = true
|
||||||
|
system-features = nixos-test benchmark big-parallel kvm
|
||||||
|
enable_kvm: true
|
||||||
|
|
||||||
|
- name: Ensure environment
|
||||||
|
run: >-
|
||||||
|
apt-get update && apt-get install -y sqlite3
|
||||||
|
if: ${{ runner.os == 'Linux' }}
|
||||||
|
|
||||||
|
- name: Restore Nix store
|
||||||
|
uses: nix-community/cache-nix-action@v5
|
||||||
|
with:
|
||||||
|
primary-key: nix-small-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
|
||||||
|
restore-prefixes-first-match: nix-small-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Build for test
|
||||||
|
id: build-test
|
||||||
|
run: >-
|
||||||
|
export FORTIFY_REV="$(git rev-parse --short HEAD)" &&
|
||||||
|
sed -i.old 's/version = /version = "0.0.0-'$FORTIFY_REV'"; # version = /' package.nix &&
|
||||||
|
nix build --print-out-paths --print-build-logs .#dist &&
|
||||||
|
mv package.nix.old package.nix &&
|
||||||
|
echo "rev=$FORTIFY_REV" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Upload test build
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: "fortify-${{ steps.build-test.outputs.rev }}"
|
||||||
|
path: result/*
|
||||||
|
retention-days: 1
|
@ -5,7 +5,7 @@ on:
|
|||||||
- pull_request
|
- pull_request
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
tests:
|
||||||
name: Run NixOS test
|
name: Run NixOS test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@ -30,13 +30,8 @@ jobs:
|
|||||||
- name: Restore Nix store
|
- name: Restore Nix store
|
||||||
uses: nix-community/cache-nix-action@v5
|
uses: nix-community/cache-nix-action@v5
|
||||||
with:
|
with:
|
||||||
primary-key: flake-check-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
|
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
|
||||||
restore-prefixes-first-match: flake-check-${{ runner.os }}-
|
restore-prefixes-first-match: nix-${{ runner.os }}-
|
||||||
gc-max-store-size-linux: 1073741824
|
|
||||||
purge: true
|
|
||||||
purge-prefixes: flake-check-${{ runner.os }}-
|
|
||||||
purge-created: 60
|
|
||||||
purge-primary-key: never
|
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
@ -46,55 +41,6 @@ jobs:
|
|||||||
- name: Upload test output
|
- name: Upload test output
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: "nixos-vm-output"
|
name: "result"
|
||||||
path: result/*
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
dist:
|
|
||||||
name: Create distribution
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
||||||
|
|
||||||
- name: Install Nix
|
|
||||||
uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30
|
|
||||||
with:
|
|
||||||
# explicitly enable sandbox
|
|
||||||
install_options: --daemon
|
|
||||||
extra_nix_config: |
|
|
||||||
sandbox = true
|
|
||||||
system-features = nixos-test benchmark big-parallel kvm
|
|
||||||
enable_kvm: true
|
|
||||||
|
|
||||||
- name: Ensure environment
|
|
||||||
run: >-
|
|
||||||
apt-get update && apt-get install -y sqlite3
|
|
||||||
if: ${{ runner.os == 'Linux' }}
|
|
||||||
|
|
||||||
- name: Restore Nix store
|
|
||||||
uses: nix-community/cache-nix-action@v5
|
|
||||||
with:
|
|
||||||
primary-key: build-dist-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
|
|
||||||
restore-prefixes-first-match: build-dist-${{ runner.os }}-
|
|
||||||
gc-max-store-size-linux: 1073741824
|
|
||||||
purge: true
|
|
||||||
purge-prefixes: build-dist-${{ runner.os }}-
|
|
||||||
purge-created: 60
|
|
||||||
purge-primary-key: never
|
|
||||||
|
|
||||||
- name: Build for test
|
|
||||||
id: build-test
|
|
||||||
run: >-
|
|
||||||
export FORTIFY_REV="$(git rev-parse --short HEAD)" &&
|
|
||||||
sed -i.old 's/version = /version = "0.0.0-'$FORTIFY_REV'"; # version = /' package.nix &&
|
|
||||||
nix build --print-out-paths --print-build-logs .#dist &&
|
|
||||||
mv package.nix.old package.nix &&
|
|
||||||
echo "rev=$FORTIFY_REV" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Upload test build
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: "fortify-${{ steps.build-test.outputs.rev }}"
|
|
||||||
path: result/*
|
path: result/*
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
Loading…
Reference in New Issue
Block a user