From 85e64f44cfc78176830c598e35468d490bc8f7a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Wed, 10 May 2023 15:59:06 +0200 Subject: [PATCH 1/2] chore: test checking out forked repository --- .github/workflows/main.yml | 51 ++++++++++++++++++++++++++++---------- ci/slab.toml | 2 +- 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d36d1c4..b4a0912 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,6 +24,15 @@ on: request_id: description: 'Slab request ID' type: string + fork_user: + description: 'User login of forked repo' + type: string + fork_git_ref: + description: 'Git ref to checkout from fork' + type: string + +env: + REPOSITORY: ${{ inputs.fork_user || github.repository_owner}}/caesar-cipher jobs: tests1: @@ -37,22 +46,38 @@ jobs: echo "Type: ${{ github.event.inputs.instance_type }}" echo "Request ID: ${{ github.event.inputs.request_id }}" echo "Matrix item: ${{ github.event.inputs.matrix_item }}" - - uses: actions/checkout@v2 - - name: Set up home - run: | - echo "HOME=/home/ubuntu" >> ${GITHUB_ENV} - - name: Install Rust - if: ${{ !cancelled() }} - uses: actions-rs/toolchain@v1 + echo "Fork user: ${{ github.event.inputs.fork_user }}" + echo "Fork git ref: ${{ github.event.inputs.fork_git_ref }}" + + - name: Checkout repository + uses: actions/checkout@v2 with: - toolchain: stable - override: true - - name: Run test suite with cargo - run: cargo test + repository: ${{ env.REPOSITORY }} + ref: ${{ inputs.fork_git_ref }} + + - name: Show last commit + run: | + sudo apt install -y git + git show + +# - name: Set up home +# run: | +# echo "HOME=/home/ubuntu" >> ${GITHUB_ENV} +# +# - name: Install Rust +# if: ${{ !cancelled() }} +# uses: actions-rs/toolchain@v1 +# with: +# toolchain: stable +# override: true +# +# - name: Run test suite with cargo +# run: cargo test + - name: EC2 activity tracker check #run: echo 999999^999999 | bc - run: sleep 45 -# + run: sleep 120 + # intermediate_test: # needs: tests1 # runs-on: ubuntu-latest diff --git a/ci/slab.toml b/ci/slab.toml index 191dbb9..b206d62 100644 --- a/ci/slab.toml +++ b/ci/slab.toml @@ -1,6 +1,6 @@ [profile.cpu] region = "eu-west-3" -image_id = "ami-021d41cbdefc0c994" # AWS Linux x86 +image_id = "ami-05e8e219ac7e82eba" # ubuntu 22.04 instance_type = "t3.micro" subnet_id = "subnet-0e042c7621461f754" From 548ebdaa4635693fbb47016abf315c0053ff0723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Wed, 10 May 2023 15:47:48 +0200 Subject: [PATCH 2/2] useless commit --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b4a0912..1189e07 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,7 +45,6 @@ jobs: echo "AMI: ${{ github.event.inputs.instance_image_id }}" echo "Type: ${{ github.event.inputs.instance_type }}" echo "Request ID: ${{ github.event.inputs.request_id }}" - echo "Matrix item: ${{ github.event.inputs.matrix_item }}" echo "Fork user: ${{ github.event.inputs.fork_user }}" echo "Fork git ref: ${{ github.event.inputs.fork_git_ref }}"