Skip to content

Add ci

Add ci #9

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
merge_group:
jobs:
test:
name: test ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: "Fetch latest cairo-coverage version from GitHub releases"
id: version
shell: pwsh
run: |
$location = (Invoke-WebRequest -Uri "https://github.com/software-mansion/cairo-coverage/releases/latest" -Method Head -MaximumRedirection 0 -SkipHttpErrorCheck -ErrorAction Ignore).Headers.Location
$latest_version = ($location -replace '^.*/v','')
echo "Latest cairo-coverage version found is $latest_version"
echo "LATEST_VERSION=$latest_version" >> $env:GITHUB_OUTPUT
- name: "Check cairo-coverage latest"
uses: asdf-vm/actions/plugin-test@v3
with:
command: cairo-coverage --version | grep "cairo-coverage ${{ steps.version.outputs.LATEST_VERSION }}"
- name: "Check cairo-coverage v0.2.0"
uses: asdf-vm/actions/plugin-test@v3
with:
skip_install: true
version: 0.2.0
command: cairo-coverage --version | grep "cairo-coverage 0.2.0"
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: shellcheck bin/* lib/*
shfmt:
runs-on: ubuntu-latest
steps:
- uses: mfinelli/setup-shfmt@v3
- uses: actions/checkout@v4
- run: shfmt --diff .