ops(deps): bump actions/attest-build-provenance from 1 to 2 #505
Workflow file for this run
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
--- | |
name: CI | |
"on": [push, pull_request] | |
permissions: | |
id-token: write | |
contents: read | |
attestations: read | |
env: | |
ZIG_VERSION: 0.13.0 | |
jobs: | |
build-cross: | |
name: Build | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
mode: ["fast", "safe", "small", "off"] | |
target: | |
- "x86-linux" | |
- "x86_64-linux" | |
- "aarch64-linux" | |
- "x86_64-macos" | |
- "aarch64-macos" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Zig | |
uses: mlugg/setup-zig@v1 | |
with: | |
version: ${{ env.ZIG_VERSION }} | |
- name: Build | |
run: | | |
zig build -Dtarget=${{ matrix.target }} --release=${{ matrix.mode }} --verbose --summary all | |
test: | |
name: Test | |
strategy: | |
matrix: | |
os: [ubuntu, macos] | |
mode: ["fast", "safe", "small", "off"] | |
runs-on: ${{ matrix.os }}-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Zig | |
uses: mlugg/setup-zig@v1 | |
with: | |
version: ${{ env.ZIG_VERSION }} | |
- name: Build | |
run: zig build --release=${{ matrix.mode }} --verbose --summary all | |
- name: Test | |
run: zig build test --release=${{ matrix.mode }} --summary all | |
coverage: | |
name: Test coverage | |
runs-on: ubuntu-latest | |
if: "!startsWith(github.ref, 'refs/tags/')" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Zig | |
uses: mlugg/setup-zig@v1 | |
with: | |
version: ${{ env.ZIG_VERSION }} | |
- name: Install kcov | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y kcov | |
- name: Generate coverage | |
run: zig build coverage --summary all | |
- name: Upload coverage | |
uses: codecov/codecov-action@v5 | |
with: | |
directory: coverage | |
verbose: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
lint: | |
name: Format | |
runs-on: ubuntu-latest | |
if: "!startsWith(github.ref, 'refs/tags/')" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Zig | |
uses: mlugg/setup-zig@v1 | |
with: | |
version: ${{ env.ZIG_VERSION }} | |
- name: Check formatting | |
run: zig fmt --check . | |
release: | |
name: Releas | |
needs: [build-cross, test] | |
permissions: | |
contents: write | |
id-token: write | |
attestations: write | |
if: | | |
github.repository_owner == 'charlesrocket' && | |
startsWith(github.ref, 'refs/tags/') | |
uses: ./.github/workflows/cd.yml | |
with: | |
tag_name: ${{ github.ref_name }} |