Don't add terminal path pattern automatically, support user-added ins… #204
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, workflow_dispatch] | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
- uses: gacts/install-hurl@v1 | |
- name: Build | |
run: go build -v ./... | |
- name: Run Go Tests | |
run: go test -v ./... | |
- name: Run Integration Tests | |
run: go run . | |
working-directory: ./test | |
- name: Build binaries for all platforms | |
run: .github/workflows/release.sh | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ github.actor }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build docker cache | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
target: deps | |
cache-from: type=gha | |
cache-to: type=gha | |
- name: Test docker | |
run: | | |
docker build -t test --target test --build-arg --cache-from type=gha LDFLAGS="${{ env.LDFLAGS }}" .. | |
docker run --rm --name test -p 8080 test | |
go run . hurl | |
docker stop test | |
working-directory: ./test | |
- name: Build docker and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
cache-from: type=gha | |
build-args: | | |
LDFLAGS=${{ env.LDFLAGS }} | |
tags: | | |
infogulch/xtemplate:{{ env.VERSION }} | |
${{ startsWith(github.ref, 'refs/tags/v') && 'infogulch/xtemplate:latest' || null }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: xtemplate-dist | |
path: 'dist/*' | |
- name: Release | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: 'dist/*' |