Skip to content

Commit

Permalink
test: Fix CI tests for Tuist4
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien-coye committed Jul 23, 2024
1 parent 4533219 commit 7641fe6
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 3 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/apitests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: API tests workflow

on:
pull_request:
branches: [ master,release-* ]

jobs:
build:
name: Build and Test project
runs-on: [ self-hosted, iOS ]

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: jdx/mise-action@v2
with:
cache: false
- name: Checkout
uses: actions/checkout@v2
- name: Create test env
env:
ENV_PATH: "kDriveTests/Env.swift"
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
USER_ID: ${{ secrets.USER_ID }}
INVITE_USER_ID: ${{ secrets.INVITE_USER_ID }}
INVITE_EMAIL: ${{ secrets.INVITE_EMAIL }}
run: |
touch $ENV_PATH
echo -e "enum Env {\n static let token = \"$ACCESS_TOKEN\"\n\n static let driveId = 420132\n\n static let userId = $USER_ID\n\n static let inviteUserId = $INVITE_USER_ID\n\n static let inviteMail = \"$INVITE_EMAIL\"\n\n static let inviteTeam = 0\n\n static let commonDocumentsId = 3\n}" > $ENV_PATH
- name: Project setup
run: tuist install && tuist generate
- name: API tests
run: tuist test kDrive --test-targets kDriveAPITests
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
touch $ENV_PATH
echo -e "enum Env {\n static let token = \"$ACCESS_TOKEN\"\n\n static let driveId = 420132\n\n static let userId = $USER_ID\n\n static let inviteUserId = $INVITE_USER_ID\n\n static let inviteMail = \"$INVITE_EMAIL\"\n\n static let inviteTeam = 0\n\n static let commonDocumentsId = 3\n}" > $ENV_PATH
- name: Build
run: tuist install && tuist build --generate kDrive
- name: Test
run: tuist test kDrive --test-targets kDriveTests/DriveApiTests
run: tuist install && tuist generate && tuist build
- name: Unit Test
run: tuist test kDrive --skip-ui-tests
- name: UI tests
run: tuist test --device "iPhone 15 Pro" --test-targets kDriveUITests
35 changes: 35 additions & 0 deletions .github/workflows/uitests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: UI tests workflow

on:
pull_request:
branches: [ master,release-* ]

jobs:
build:
name: Build and Test project
runs-on: [ self-hosted, iOS ]

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: jdx/mise-action@v2
with:
cache: false
- name: Checkout
uses: actions/checkout@v2
- name: Create test env
env:
ENV_PATH: "kDriveTests/Env.swift"
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
USER_ID: ${{ secrets.USER_ID }}
INVITE_USER_ID: ${{ secrets.INVITE_USER_ID }}
INVITE_EMAIL: ${{ secrets.INVITE_EMAIL }}
run: |
touch $ENV_PATH
echo -e "enum Env {\n static let token = \"$ACCESS_TOKEN\"\n\n static let driveId = 420132\n\n static let userId = $USER_ID\n\n static let inviteUserId = $INVITE_USER_ID\n\n static let inviteMail = \"$INVITE_EMAIL\"\n\n static let inviteTeam = 0\n\n static let commonDocumentsId = 3\n}" > $ENV_PATH
- name: Project setup
run: tuist install && tuist generate
- name: UI tests
run: tuist test --device "iPhone 15 Pro" --test-targets kDriveUITests

0 comments on commit 7641fe6

Please sign in to comment.