Skip to content

Commit

Permalink
Make upload/download artifacts work with act
Browse files Browse the repository at this point in the history
Signed-off-by: Timothy Johnson <[email protected]>
  • Loading branch information
t1m0thyj committed Nov 5, 2021
1 parent 088cc71 commit 6bb7c41
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
14 changes: 5 additions & 9 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,17 @@ General information about GH Workflows

1. Read about it: https://github.com/nektos/act (Requires Docker)
2. Install it https://github.com/nektos/act#installation
3. Run: `act --eventpath .github/_act_event.json --workflows .github/workflows/zowe-cli.yml --verbose --reuse`
- Equivalent: `act -vre .github/_act_event.json -W .github/workflows/zowe-cli.yml`
4. After it fails the first time, Copy the `zowe.tgz` file from the Build-Linux container to the Cross-Platform-Test container
- `docker cp act-Zowe-CLI-Build-Linux:/root/gh/zowe/zowe-cli/zowe.tgz .`
- `docker cp zowe.tgz act-Zowe-CLI-Cross-Platform-Test:/root/gh/zowe/zowe-cli/`
5. Run: `act -re .github/_act_event.json -W .github/workflows/zowe-cli.yml`
3. Run: `act --eventpath .github/_act_event.json --workflows .github/workflows/zowe-cli.yml --reuse`
- Equivalent: `act -re .github/_act_event.json -W .github/workflows/zowe-cli.yml`

`100.` To start from scratch, just remove the containers
- `docker rm act-Zowe-CLI-Build-Linux --force`
- `docker rm act-Zowe-CLI-Cross-Platform-Test --force`

**Knwon Issues for `nektos/[email protected]`**
**Known Issues for `nektos/[email protected]`**

`0.` The first time (i.e. when it is supposed to fail) it will likely take ~3 minutes to run. Subsequent runs (with `--reuse`) should take less than 2 minutes. <br/>
`1.` Artifact upload and download doesn't work on `nektos/act` (hence why we need to manually copy the zowe.tgz). <br/>
`0.` The first time it will likely take ~3 minutes to run. Subsequent runs (with `--reuse`) should take less than 2 minutes. <br/>
`1.` Artifact upload and download doesn't work on `nektos/act` (hence why we need to copy the zowe.tgz to a shared Docker volume). <br/>
`2.` `nektos/act` only works with linux distros. <br/>
`3.` `Install Rust toolchain` step was replaced with simple `yum install cargo -y` because `actions-rs/toolchain@v1` doesn't really work with `nektos/act`. <br/>
`4.` Steps context (`steps.<id>`) doesn't really work on `nektos/act` (hence why we force unit and integration tests to run). <br/>
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/zowe-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ jobs:
name: zowe-linux-latest.tgz
path: zowe.tgz

- name: Upload the Prebuilt Linux Binary
if: (github.event.run_with_act)
run: mkdir -p /toolcache/artifacts && cp zowe.tgz /toolcache/artifacts/zowe-linux-latest.tgz

test:
name: Cross-Platform Test
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -124,6 +128,10 @@ jobs:
with:
name: zowe-linux-latest.tgz

- name: Download Prebuilt Linux Binary
if: matrix.os == 'ubuntu-latest' && github.event.run_with_act
run: cp /toolcache/artifacts/zowe-linux-latest.tgz zowe.tgz

- name: Archive Binary
if: matrix.os != 'ubuntu-latest'
id: upload-binary
Expand Down

0 comments on commit 6bb7c41

Please sign in to comment.