Skip to content

Commit 55bdbd2

Browse files
committed
chore: test checking out forked repository
1 parent 2c96c77 commit 55bdbd2

File tree

2 files changed

+39
-14
lines changed

2 files changed

+39
-14
lines changed

.github/workflows/main.yml

Lines changed: 38 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_sha:
31+
description: 'Git SHA 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,38 @@ 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 sha: ${{ github.event.inputs.fork_git_sha }}"
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_sha }}
57+
58+
- name: Show last commit
59+
run: |
60+
sudo apt install -y git
61+
git show
62+
63+
# - name: Set up home
64+
# run: |
65+
# echo "HOME=/home/ubuntu" >> ${GITHUB_ENV}
66+
#
67+
# - name: Install Rust
68+
# if: ${{ !cancelled() }}
69+
# uses: actions-rs/toolchain@v1
70+
# with:
71+
# toolchain: stable
72+
# override: true
73+
#
74+
# - name: Run test suite with cargo
75+
# run: cargo test
76+
5277
- name: EC2 activity tracker check
5378
#run: echo 999999^999999 | bc
54-
run: sleep 45
55-
#
79+
run: sleep 120
80+
5681
# intermediate_test:
5782
# needs: tests1
5883
# runs-on: ubuntu-latest

ci/slab.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[profile.cpu]
22
region = "eu-west-3"
3-
image_id = "ami-021d41cbdefc0c994" # AWS Linux x86
3+
image_id = "ami-05e8e219ac7e82eba" # ubuntu 22.04
44
instance_type = "t3.micro"
55
subnet_id = "subnet-0e042c7621461f754"
66

0 commit comments

Comments
 (0)