Add Gitea Actions CI/CD
All checks were successful
CI / test (push) Successful in 10m24s

This commit is contained in:
2026-06-26 21:23:51 +09:00
parent 1a7c5878f8
commit 0de607fcdf
6 changed files with 287 additions and 1 deletions

50
.gitea/workflows/ci.yml Normal file
View 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