Added new type definitions for buffer. #143
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
on: [push, pull_request] | |
name: Test | |
jobs: | |
test: | |
strategy: | |
matrix: | |
go-version: [1.20.x, 1.x] | |
os: [ubuntu-latest, windows-latest] | |
arch: ["", "386"] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Check formatting | |
run: diff -u <(echo -n) <(gofmt -d .) | |
if: runner.os != 'Windows' | |
- name: Run go vet | |
env: | |
GOARCH: ${{ matrix.arch }} | |
run: go vet ./... | |
- name: Run staticcheck | |
uses: dominikh/staticcheck-action@v1.3.1 | |
with: | |
version: "2024.1.1" | |
install-go: false | |
cache-key: ${{ matrix.go-version }} | |
if: ${{ matrix.go-version == '1.x' }} | |
- name: Run tests | |
env: | |
GOARCH: ${{ matrix.arch }} | |
run: go test -vet=off ./... | |
test-types: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
npm ci | |
npm test --workspaces | |
publish-types: | |
name: 'Publish type definitions to npm' | |
needs: [test, test-types] | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') || github.ref_name == 'master' || github.ref_name == 'type-definitions' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Extract version | |
run: | | |
VERSION=$(echo "${{ github.ref }}" | sed 's|refs/tags/v||') | |
if [[ "$VERSION" == [0-9].* ]]; then | |
echo "version=$VERSION" >> $GITHUB_ENV | |
fi | |
- uses: './.github/actions/publish-types' | |
if: env.version != '' | |
with: | |
VERSION: ${{ env.version }} | |
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} | |
publish-types-test: | |
needs: [ test-types ] | |
runs-on: ubuntu-latest | |
if: "!startsWith(github.ref, 'refs/tags/v')" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Extract version | |
run: | | |
VERSION=0.0.0-$(git log -1 --format=%cd --date=format:%Y%m%d%H%M%S)-$(git rev-parse --short=12 HEAD) | |
echo "version=$VERSION" >> $GITHUB_ENV | |
- uses: './.github/actions/publish-types' | |
if: env.version != '' | |
with: | |
VERSION: ${{ env.version }} | |
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} |