Skip to content

Commit 516c04a

Browse files
Fix working-directory not working (#62)
1 parent e596b4f commit 516c04a

3 files changed

Lines changed: 38 additions & 5 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: matrix
2+
on: push
3+
jobs:
4+
matrix-test:
5+
strategy:
6+
matrix:
7+
container:
8+
- ""
9+
- "ubuntu:latest"
10+
runs-on: [self-hosted]
11+
steps:
12+
- run: |
13+
mkdir -p test
14+
echo World > test/Hello.txt
15+
- id: relative-path
16+
run: |
17+
echo "::set-output name=hello::$(cat Hello.txt)"
18+
working-directory: test
19+
- id: absolute-path
20+
run: |
21+
echo "::set-output name=hello::$(cat Hello.txt)"
22+
working-directory: ${{github.workspace}}/test
23+
- run: exit ${{steps.relative-path.outputs.hello == 'World' && steps.absolute-path.outputs.hello == 'World' && '0' || '1' }}

.github/workflows/build.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
name: CI
22
on:
33
push:
4+
branches:
5+
- main
6+
pull_request:
47
workflow_dispatch:
58
inputs:
69
version:
710
description: 'Version of the Release'
811
changelog:
9-
description: 'Changelog of the Release'
12+
description: 'Changelog of the Release'
13+
skip-packaging:
14+
description: 'Skip packaging'
15+
type: boolean
1016

1117
env:
1218
RUNNER_DEV_VERSION: "0.2.x"
@@ -79,13 +85,13 @@ jobs:
7985
GOOS: ${{matrix.GOOS}}
8086
GOARCH: ${{matrix.GOARCH}}
8187
- name: Package tar
82-
if: ${{matrix.GOOS != 'windows'}}
88+
if: ${{ github.event.inputs.skip-packaging != 'true' && matrix.GOOS != 'windows' }}
8389
run: |
8490
cp compat/*.sh output/
8591
cd output
8692
tar czf ../binary-${{matrix.GOOS}}-${{matrix.GOARCH}}.tar.gz ./*
8793
- name: Package zip
88-
if: ${{matrix.GOOS == 'windows'}}
94+
if: ${{ github.event.inputs.skip-packaging != 'true' && matrix.GOOS == 'windows' }}
8995
run: |
9096
cp compat/*.cmd output/
9197
cd output
@@ -95,6 +101,7 @@ jobs:
95101
name: binary-${{matrix.GOOS}}-${{matrix.GOARCH}}
96102
path: github-act-runner-${{matrix.GOOS}}-${{matrix.GOARCH}}${{matrix.suffix}}
97103
- uses: actions/upload-artifact@v2
104+
if: ${{ github.event.inputs.skip-packaging != 'true' }}
98105
with:
99106
name: bundle-${{matrix.GOOS}}-${{matrix.GOARCH}}
100107
path: 'binary-${{matrix.GOOS}}-${{matrix.GOARCH}}.*'
@@ -105,7 +112,7 @@ jobs:
105112
name: deploy to github
106113
runs-on: ubuntu-latest
107114
needs: build
108-
if: ${{ github.event.inputs.version }}
115+
if: ${{ github.event.inputs.skip-packaging != 'true' && github.event.inputs.version }}
109116
continue-on-error: true
110117
steps:
111118
- uses: actions/download-artifact@v2
@@ -140,6 +147,7 @@ jobs:
140147
needs: build
141148
runs-on: ubuntu-latest
142149
name: build and deploy to deb repo
150+
if: ${{ github.event.inputs.skip-packaging != 'true' }}
143151
env:
144152
DEPLOY_ARCHS: "amd64 i386 armhf arm64" # architectures from https://wiki.debian.org/SupportedArchitectures
145153
steps:
@@ -184,6 +192,7 @@ jobs:
184192
run-tests:
185193
needs: build
186194
runs-on: ubuntu-latest
195+
if: ${{ github.event.inputs.skip-packaging != 'true' }}
187196
steps:
188197
- uses: actions/checkout@v2
189198
- name: Prepare actions-runner
@@ -213,6 +222,7 @@ jobs:
213222
sudo prlimit --pid $! --nofile=16:16
214223
sleep 2
215224
./actions-runner/bin/Runner.Client --server http://localhost:5000 -W ./.github/testworkflows --log-output-dir ./logs
225+
./actions-runner/bin/Runner.Client --server http://localhost:5000 -W ./.github/testworkflows/working-directory.yml --log-output-dir ./logs
216226
./actions-runner/bin/Runner.Client --server http://localhost:5000 -W ./.github/failingtestworkflows/test_container_fail_step.yml --log-output-dir ./logs && exit 1 || [[ "$?" = "1" ]]
217227
./actions-runner/bin/Runner.Client --server http://localhost:5000 -W ./.github/failingtestworkflows/test_host_fail_step.yml --log-output-dir ./logs && exit 1 || [[ "$?" = "1" ]]
218228

act

0 commit comments

Comments
 (0)