feature: add root suite #106
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
name: Build Binaries | |
on: [ push ] | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
max-parallel: 4 | |
matrix: | |
os: [ ubuntu-latest, macOS-latest ] | |
architecture: [ arm64, amd64 ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install dependencies (Ubuntu) | |
if: runner.os == 'Linux' | |
run: sudo apt-get update -qq | |
- name: Set up Go | |
uses: actions/setup-go@v5.0.1 | |
with: | |
go-version-file: go.mod | |
- name: Run lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: latest | |
- name: Run tests | |
run: make test | |
build-n-publish: | |
strategy: | |
fail-fast: false | |
max-parallel: 4 | |
matrix: | |
os: [ ubuntu-latest, macOS-latest ] | |
architecture: [ arm64, amd64 ] | |
runs-on: ${{ matrix.os }} | |
if: startsWith(github.event.ref, 'refs/tags') | |
needs: test | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Get latest tag | |
id: tag | |
run: echo "TAG=$(git describe --tags)" >> $GITHUB_ENV | |
- name: Install dependencies (Ubuntu) | |
if: runner.os == 'Linux' | |
run: sudo apt-get update -qq | |
- name: Set up Go | |
uses: actions/setup-go@v5.0.1 | |
with: | |
go-version-file: go.mod | |
- name: Build binary | |
run: | | |
GOARCH=${{ matrix.architecture }} make build | |
mv build/qli qli-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }} | |
- name: Generate Checksum | |
id: checksum | |
run: | | |
if [[ "${{ runner.os }}" == "macOS" ]]; then | |
shasum -a 256 qli-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }} > qli-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }}.sha256 | |
else | |
sha256sum qli-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }} > qli-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }}.sha256 | |
fi | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: qli-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }} | |
path: | | |
qli-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }} | |
qli-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }}.sha256 | |
build-docker-n-publish: | |
runs-on: ubuntu-latest | |
needs: test | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Define the tag for the Docker image | |
# actions/checkout is making a shallow copy, so unless it's a tag event, | |
# tag will be empty; in such case, use shortened commit SHA | |
id: tag | |
run: echo "TAG=$(git describe --tags || git rev-parse --short HEAD)" >> $GITHUB_ENV | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image | |
id: push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./build/Dockerfile | |
push: ${{ startsWith(github.event.ref, 'refs/tags') }} | |
provenance: false | |
tags: ghcr.io/qase-tms/qase-cli:${{ env.TAG }},ghcr.io/qase-tms/qase-cli:latest | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
VERSION=${{ env.TAG }} |