ci: Rework CI based on current XCbuild command #1334
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI workflow | |
on: | |
pull_request: | |
branches: [ master,release-* ] | |
jobs: | |
build: | |
name: Build project | |
runs-on: [ self-hosted, iOS ] | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- 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: Tuist generate | |
run: .tuist-bin/tuist generate | |
- name: Build | |
run: .tuist-bin/tuist build kDrive | |
test_unit_itegration: | |
name: Unit & Integration tests | |
runs-on: [ self-hosted, iOS ] | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- 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: Tuist generate | |
run: .tuist-bin/tuist generate | |
- name: Test | |
run: xcodebuild test -workspace kDrive.xcworkspace -scheme kDrive -allowProvisioningUpdates -only-testing "kDriveTests" -destination "platform=iOS Simulator,name=iPhone 15,OS=17.0" | |
test_ui: | |
name: UITests | |
runs-on: [ self-hosted, iOS ] | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- 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: Tuist generate | |
run: .tuist-bin/tuist generate | |
- name: Test | |
run: xcodebuild test -workspace kDrive.xcworkspace -scheme kDrive -allowProvisioningUpdates -only-testing "kDriveUITests" -destination "platform=iOS Simulator,name=iPhone 15,OS=17.0" | |
test_unit_itegration_legacy: | |
name: Unit & Integration tests on legacy OS | |
runs-on: [ self-hosted, iOS ] | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- 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: Tuist generate | |
run: .tuist-bin/tuist generate | |
- name: Test Legacy | |
run: xcodebuild test -workspace kDrive.xcworkspace -scheme kDrive -allowProvisioningUpdates -only-testing "kDriveTests" -destination "platform=iOS Simulator,name=iPhone X,OS=13.0" | |
test_api: | |
name: API tests | |
runs-on: [ self-hosted, iOS ] | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Create test env | |
env: | |
ENV_PATH: "kDriveAPITests/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: Tuist generate | |
run: .tuist-bin/tuist generate | |
- name: Test API | |
run: xcodebuild test -workspace kDrive.xcworkspace -scheme kDriveAPITests -allowProvisioningUpdates -destination "platform=iOS Simulator,name=iPhone 15,OS=17.0" |