-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (49 loc) · 1.46 KB
/
test-e2e.yml
File metadata and controls
60 lines (49 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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