This commit is contained in:
50
.gitea/workflows/ci.yml
Normal file
50
.gitea/workflows/ci.yml
Normal file
@@ -0,0 +1,50 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: https://github.com/actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache: true
|
||||
|
||||
- name: Download dependencies
|
||||
run: go mod download
|
||||
|
||||
- name: Check formatting
|
||||
run: |
|
||||
files="$(gofmt -l cmd/dataxl/*.go)"
|
||||
if [ -n "$files" ]; then
|
||||
echo "gofmt is required:"
|
||||
echo "$files"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Run tests
|
||||
run: go test ./...
|
||||
|
||||
- name: Build
|
||||
run: go build ./cmd/dataxl
|
||||
|
||||
- name: Smoke test
|
||||
run: |
|
||||
./dataxl -from yaml -to tsv -i examples/people.yaml > /tmp/people.tsv
|
||||
grep -q 'user.name' /tmp/people.tsv
|
||||
./dataxl -from tsv -to json < /tmp/people.tsv > /tmp/people.json
|
||||
grep -q '"name": "Alice"' /tmp/people.json
|
||||
42
.gitea/workflows/release.yml
Normal file
42
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: Version tag to release, for example v0.1.0
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: https://github.com/actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache: true
|
||||
|
||||
- name: Run tests
|
||||
run: go test ./...
|
||||
|
||||
- name: Build release archives
|
||||
env:
|
||||
RELEASE_TAG: ${{ inputs.tag }}
|
||||
run: scripts/build-release.sh
|
||||
|
||||
- name: Publish Gitea release
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
RELEASE_TAG: ${{ inputs.tag }}
|
||||
run: scripts/publish-gitea-release.sh
|
||||
Reference in New Issue
Block a user