From 7106141e65f2e358248d0766118cd389d7eb4cb1 Mon Sep 17 00:00:00 2001 From: TazyFoundSoup Date: Wed, 15 Apr 2026 17:31:59 +1000 Subject: feat(ci/cd): More CI/CD --- .github/workflows/build.yaml | 30 ++++++++++++++++++ .github/workflows/canary.yaml | 65 ++++++++++++++++++++++++++++++++++++++ .github/workflows/tests-image.yaml | 20 ++++++++++++ 3 files changed, 115 insertions(+) create mode 100644 .github/workflows/build.yaml create mode 100644 .github/workflows/canary.yaml create mode 100644 .github/workflows/tests-image.yaml (limited to '.github') diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..54bc5b0 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,30 @@ +name: build + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + name: ${{ matrix.os }} / ${{ matrix.cc }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + cc: gcc + - os: ubuntu-latest + cc: clang + - os: macos-latest + cc: clang + - os: windows-latest + cc: gcc + + steps: + - uses: actions/checkout@v4 + + - name: Build + run: make CC=${{ matrix.cc }} USE_HOSTED=1 diff --git a/.github/workflows/canary.yaml b/.github/workflows/canary.yaml new file mode 100644 index 0000000..2a4a795 --- /dev/null +++ b/.github/workflows/canary.yaml @@ -0,0 +1,65 @@ +name: canary + +on: + push: + branches: [ "master" ] + +jobs: + build: + name: ${{ matrix.artifact }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + cc: gcc + artifact: libtinyff-linux-x86_64.a + - os: macos-latest + cc: clang + artifact: libtinyff-macos-aarch64.a + - os: windows-latest + cc: gcc + artifact: libtinyff-windows-x86_64.a + + steps: + - uses: actions/checkout@v4 + + - name: Build + run: make CC=${{ matrix.cc }} USE_HOSTED=1 + + - name: Copy artifact + run: cp dist/libtinyff.a ${{ matrix.artifact }} + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.artifact }} + path: ${{ matrix.artifact }} + + release: + name: Publish canary + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + + - name: Delete existing canary + run: gh release delete canary --yes --cleanup-tag || true + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + + - name: Create canary release + uses: softprops/action-gh-release@v2 + with: + tag_name: canary + name: "canary (${{ github.sha }})" + prerelease: true + make_latest: false + body: | + Automated canary build from `${{ github.sha }}`. + Built on ${{ github.event.head_commit.timestamp }}. + + > ⚠️ This is a rolling prerelease. Not recommended for production use. + files: "**/*.a" diff --git a/.github/workflows/tests-image.yaml b/.github/workflows/tests-image.yaml new file mode 100644 index 0000000..edb0d0f --- /dev/null +++ b/.github/workflows/tests-image.yaml @@ -0,0 +1,20 @@ +name: tests-image + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + test-png: + name: PNG + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build + run: make USE_HOSTED=1 + + - name: Run PNG tests + run: make test-png USE_HOSTED=1 \ No newline at end of file -- cgit v1.2.3