diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-01-16 17:32:52 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-01-16 17:32:52 +0900 |
| commit | b60c01f4405ec3b5cc4a740fe994c3b9f39cf01f (patch) | |
| tree | 3d43cd726a26bba2336d2373a6dfe65a567a35a8 /.gitea | |
| parent | 124743ffd3da7c31ef9c562593e15d88bb19008e (diff) | |
fortify: switch to static linking
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to '.gitea')
| -rw-r--r-- | .gitea/workflows/build.yml (renamed from .gitea/workflows/nix.yml) | 26 | ||||
| -rw-r--r-- | .gitea/workflows/release.yml | 53 | ||||
| -rw-r--r-- | .gitea/workflows/test.yml | 68 |
3 files changed, 67 insertions, 80 deletions
diff --git a/.gitea/workflows/nix.yml b/.gitea/workflows/build.yml index 36651a50..3b7cfe79 100644 --- a/.gitea/workflows/nix.yml +++ b/.gitea/workflows/build.yml @@ -1,12 +1,12 @@ -name: Nix +name: Build on: - push - pull_request jobs: - tests: - name: NixOS tests + dist: + name: Create distribution runs-on: ubuntu-latest steps: - name: Checkout @@ -30,17 +30,21 @@ jobs: - name: Restore Nix store uses: nix-community/cache-nix-action@v5 with: - primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix') }} - restore-prefixes-first-match: nix-${{ runner.os }}- + primary-key: nix-small-${{ runner.os }}-${{ hashFiles('**/*.nix') }} + restore-prefixes-first-match: nix-small-${{ runner.os }}- - - name: Run tests - run: | - nix --print-build-logs --experimental-features 'nix-command flakes' flake check --all-systems - nix build --out-link "result" --print-out-paths --print-build-logs .#checks.x86_64-linux.nixos-tests + - 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 output + - name: Upload test build uses: actions/upload-artifact@v3 with: - name: "result" + name: "fortify-${{ steps.build-test.outputs.rev }}" path: result/* retention-days: 1 diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 545274db..40827d2d 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -1,53 +1,52 @@ -name: Create distribution +name: Release on: push: tags: - - '*' + - 'v*' jobs: release: - name: Release + name: Create release runs-on: ubuntu-latest - container: - image: node:16-bookworm-slim steps: - - name: Get dependencies - run: >- - echo 'deb http://deb.debian.org/debian bookworm-backports main' >> /etc/apt/sources.list.d/backports.list && - apt-get update && - apt-get install -y - acl - git - gcc - pkg-config - libwayland-dev - wayland-protocols/bookworm-backports - libxcb1-dev - libacl1-dev - if: ${{ runner.os == 'Linux' }} - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Setup go uses: https://github.com/actions/setup-go@v5 with: go-version: '>=1.23.0' - - name: Go generate + - 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: >- - go generate ./... + 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 release - run: FORTIFY_VERSION='${{ github.ref_name }}' ./dist/release.sh + id: build-test + run: nix build --print-out-paths --print-build-logs .#dist - name: Release id: use-go-action uses: https://gitea.com/actions/release-action@main with: files: |- - dist/fortify-** + result/fortify-** api_key: '${{secrets.RELEASE_TOKEN}}' diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 9add0f45..4d7a871d 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -1,62 +1,46 @@ -name: Tests +name: Test on: - push - pull_request jobs: - test: - name: Go tests + tests: + name: Run NixOS test runs-on: ubuntu-latest - container: - image: node:16-bookworm-slim steps: - - name: Enable backports - run: >- - echo 'deb http://deb.debian.org/debian bookworm-backports main' >> /etc/apt/sources.list.d/backports.list - if: ${{ runner.os == 'Linux' }} + - 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 curl wget sudo libxml2 - if: ${{ runner.os == 'Linux' }} - - - name: Get dependencies - uses: awalsh128/cache-apt-pkgs-action@latest - with: - packages: acl git gcc pkg-config libwayland-dev wayland-protocols/bookworm-backports libxcb1-dev libacl1-dev - version: 1.0 - #execute_install_scripts: true + apt-get update && apt-get install -y sqlite3 if: ${{ runner.os == 'Linux' }} - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup go - uses: https://github.com/actions/setup-go@v5 + - name: Restore Nix store + uses: nix-community/cache-nix-action@v5 with: - go-version: '>=1.23.0' - - - name: Go generate - run: >- - go generate ./... + primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix') }} + restore-prefixes-first-match: nix-${{ runner.os }}- - name: Run tests - run: >- - go test ./... - - - name: Build for test - id: build-test - run: >- - FORTIFY_VERSION="$(git rev-parse --short HEAD)" - bash -c './dist/release.sh && - echo "rev=$FORTIFY_VERSION" >> $GITHUB_OUTPUT' + run: | + nix --print-build-logs --experimental-features 'nix-command flakes' flake check --all-systems + nix build --out-link "result" --print-out-paths --print-build-logs .#checks.x86_64-linux.nixos-tests - - name: Upload test build + - name: Upload test output uses: actions/upload-artifact@v3 with: - name: "fortify-${{ steps.build-test.outputs.rev }}" - path: dist/fortify-* + name: "result" + path: result/* retention-days: 1 |
