Task E2E Test #13
This file contains hidden or 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: Task E2E Test | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| task_version: | |
| description: 'Task version to build' | |
| required: false | |
| default: '' | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: task | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Check version cache | |
| id: cache | |
| run: | | |
| if [ -f .task-version ]; then | |
| CACHED_VERSION=$(cat .task-version) | |
| echo "cached_version=${CACHED_VERSION}" >> $GITHUB_OUTPUT | |
| echo "Cached Task version: ${CACHED_VERSION}" | |
| else | |
| echo "cached_version=main" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Extract version | |
| id: version | |
| run: | | |
| VERSION=${{ github.event.inputs.task_version || steps.cache.outputs.cached_version }} | |
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
| echo "VERSION=${VERSION#v}" >> $GITHUB_ENV | |
| - name: Clone Task | |
| run: | | |
| git clone --depth 1 --branch ${{ steps.version.outputs.version }} https://github.com/go-task/task.git | |
| - name: Build Task | |
| run: | | |
| cd task; CGO_ENABLED=0 go build -ldflags="-w -s" -o task ./cmd/task | |
| echo "$GITHUB_WORKSPACE/task" >> "$GITHUB_PATH" | |
| - name: Setup Info | |
| run: | | |
| make info | |
| - name: Run E2E Tests | |
| run: | | |
| make test | |