Skip to content

Commit 04d7ddf

Browse files
committed
chore: test checking out forked repository
1 parent 2c96c77 commit 04d7ddf

File tree

1 file changed

+37
-13
lines changed

1 file changed

+37
-13
lines changed

.github/workflows/main.yml

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ on:
2424
request_id:
2525
description: 'Slab request ID'
2626
type: string
27+
fork_user:
28+
description: 'User login of forked repo'
29+
type: string
30+
fork_git_ref:
31+
description: 'Git ref to checkout from fork'
32+
type: string
33+
34+
env:
35+
REPOSITORY: ${{ inputs.fork_user || github.repository_owner}}/caesar-cipher
2736

2837
jobs:
2938
tests1:
@@ -37,22 +46,37 @@ jobs:
3746
echo "Type: ${{ github.event.inputs.instance_type }}"
3847
echo "Request ID: ${{ github.event.inputs.request_id }}"
3948
echo "Matrix item: ${{ github.event.inputs.matrix_item }}"
40-
- uses: actions/checkout@v2
41-
- name: Set up home
42-
run: |
43-
echo "HOME=/home/ubuntu" >> ${GITHUB_ENV}
44-
- name: Install Rust
45-
if: ${{ !cancelled() }}
46-
uses: actions-rs/toolchain@v1
49+
echo "Fork user: ${{ github.event.inputs.fork_user }}"
50+
echo "Fork git ref: ${{ github.event.inputs.fork_git_ref }}"
51+
52+
- name: Checkout repository
53+
uses: actions/checkout@v2
4754
with:
48-
toolchain: stable
49-
override: true
50-
- name: Run test suite with cargo
51-
run: cargo test
55+
repository: ${{ env.REPOSITORY }}
56+
ref: ${{ inputs.fork_git_ref }}
57+
58+
- name: Show last commit
59+
run: |
60+
git show
61+
62+
# - name: Set up home
63+
# run: |
64+
# echo "HOME=/home/ubuntu" >> ${GITHUB_ENV}
65+
#
66+
# - name: Install Rust
67+
# if: ${{ !cancelled() }}
68+
# uses: actions-rs/toolchain@v1
69+
# with:
70+
# toolchain: stable
71+
# override: true
72+
#
73+
# - name: Run test suite with cargo
74+
# run: cargo test
75+
5276
- name: EC2 activity tracker check
5377
#run: echo 999999^999999 | bc
54-
run: sleep 45
55-
#
78+
run: sleep 120
79+
5680
# intermediate_test:
5781
# needs: tests1
5882
# runs-on: ubuntu-latest

0 commit comments

Comments
 (0)