From 78fd561c7427bf08ca7d8883eb5b423f8b2cc4b0 Mon Sep 17 00:00:00 2001 From: Owen Rummage Date: Fri, 17 Jul 2026 14:10:37 -0500 Subject: [PATCH] add ci, almost ready --- .github/workflows/release.yml | 95 +++++++++++++++++++++++++++++++++++ README.md | 6 +++ 2 files changed, 101 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3addf59 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,95 @@ +name: Build and release + +on: + push: + tags: + - '**' + +permissions: + contents: read + +jobs: + test: + name: Test (${{ matrix.os }}) + strategy: + matrix: + os: + - ubuntu-24.04 + - macos-14 + runs-on: ${{ matrix.os }} + steps: + - name: Check out source + uses: actions/checkout@v4 + + - name: Run kernel correctness tests + run: make test + + build: + name: Build ${{ matrix.target }} + strategy: + fail-fast: false + matrix: + include: + - target: linux-amd64 + os: ubuntu-24.04 + - target: linux-arm64 + os: ubuntu-24.04 + - target: macos-amd64 + os: macos-14 + - target: macos-arm64 + os: macos-14 + runs-on: ${{ matrix.os }} + steps: + - name: Check out source + uses: actions/checkout@v4 + + - name: Install the Linux ARM64 cross-compiler + if: matrix.target == 'linux-arm64' + run: | + sudo apt-get update + sudo apt-get install --yes gcc-aarch64-linux-gnu + + - name: Build + run: make ${{ matrix.target }} + + - name: Package artifact + run: tar -czf fossmark-${{ matrix.target }}.tar.gz -C dist fossmark-${{ matrix.target }} + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: fossmark-${{ matrix.target }} + path: fossmark-${{ matrix.target }}.tar.gz + if-no-files-found: error + + release: + name: Create GitHub release + needs: + - test + - build + runs-on: ubuntu-24.04 + permissions: + contents: write + steps: + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + pattern: fossmark-* + path: release + merge-multiple: true + + - name: Create checksums + working-directory: release + run: sha256sum fossmark-*.tar.gz > SHA256SUMS + + - name: Create release and attach artifacts + env: + GH_TOKEN: ${{ github.token }} + RELEASE_TAG: ${{ github.ref_name }} + run: | + gh release create "$RELEASE_TAG" \ + release/fossmark-*.tar.gz \ + release/SHA256SUMS \ + --repo "$GITHUB_REPOSITORY" \ + --title "Release $RELEASE_TAG" \ + --generate-notes diff --git a/README.md b/README.md index bad4d76..af89199 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,12 @@ Run the benchmark with extra per-test details by passing `--verbose`: The exact filename depends on the host platform and architecture. +## Continuous integration and releases + +Pushing a Git tag runs the GitHub Actions build and correctness tests. If they +succeed, the workflow creates a GitHub Release named `Release ` with +Linux and macOS archives for AMD64 and ARM64, plus a `SHA256SUMS` file. + ## Scores Each workload receives a score relative to a reference rate: