chore(deps): bump actions/download-artifact from 1 to 4.1.7 in /.github/workflows #330
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: UI Automated Tests on MacOS | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened, edited] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-app: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Set up cargo cache | |
uses: actions/cache@v3 | |
continue-on-error: false | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ runner.os }}-cargo- | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
- name: Install Protobuf | |
continue-on-error: true | |
run: | | |
brew update | |
brew install protobuf | |
- name: Add Targets | |
env: | |
MACOSX_DEPLOYMENT_TARGET: "11.7.1" | |
run: | | |
rustup target add x86_64-apple-darwin | |
- name: Codesign and Build executable | |
env: | |
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} | |
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }} | |
MACOS_CERTIFICATE_NAME: ${{ secrets.MACOS_CERTIFICATE_NAME }} | |
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }} | |
run: | | |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12 | |
security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" builduplink.keychain | |
security default-keychain -s builduplink.keychain | |
security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" builduplink.keychain | |
security set-keychain-settings builduplink.keychain | |
security import certificate.p12 -k builduplink.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign | |
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_CI_KEYCHAIN_PWD" builduplink.keychain | |
make dmg | |
- name: "Notarize executable" | |
env: | |
PROD_MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.MACOS_NOTARIZATION_APPLE_ID }} | |
PROD_MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.MACOS_NOTARIZATION_TEAM_ID }} | |
PROD_MACOS_NOTARIZATION_PWD: ${{ secrets.MACOS_NOTARIZATION_PWD }} | |
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }} | |
run: | | |
echo "Create keychain profile" | |
xcrun notarytool store-credentials "uplink-notarytool-profile" --apple-id "$PROD_MACOS_NOTARIZATION_APPLE_ID" --team-id "$PROD_MACOS_NOTARIZATION_TEAM_ID" --password "$PROD_MACOS_NOTARIZATION_PWD" | |
echo "Creating temp notarization archive" | |
ditto -c -k --keepParent "target/release/macos/Uplink.app" "notarization.zip" | |
echo "Notarize app" | |
xcrun notarytool submit "notarization.zip" --keychain-profile "uplink-notarytool-profile" --wait | |
echo "Attach staple" | |
xcrun stapler staple "target/release/macos/Uplink.app" | |
- name: Create ZIP archive | |
run: | | |
ditto -c -k --sequesterRsrc --keepParent target/release/macos/Uplink.app Uplink-Mac-Universal.zip | |
- name: Calculate hashes | |
run: | | |
shasum -a 256 Uplink-Mac-Universal.zip > Uplink-Mac-Universal.zip.sha256.txt | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
env: | |
NODE_OPTIONS: "--max-old-space-size=8192" | |
with: | |
name: app-macos | |
path: | | |
Uplink-Mac-Universal.zip | |
Uplink-Mac-Universal.zip.sha256.txt | |
test: | |
needs: build-app | |
runs-on: macos-latest | |
steps: | |
- name: Checkout working directory 🔖 | |
uses: actions/checkout@v3 | |
- name: Enable opening app not codesigned | |
run: sudo spctl --master-disable | |
- name: Download the app 🗳️ | |
uses: actions/[email protected] | |
with: | |
name: app-macos | |
path: appium-tests/apps | |
- name: Copy DMG to Appium Apps Directory | |
working-directory: appium-tests/apps | |
run: | | |
ls -la | |
unzip Uplink-Mac-Universal.zip | |
cp -r ./Uplink.app /Applications/ | |
sudo xattr -r -d com.apple.quarantine /Applications/Uplink.app | |
- name: Setup Node.js 🔨 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Install NPM dependencies 📦 | |
run: | | |
cd appium-tests && npm install | |
- name: Install and Run Appium Server 📱 | |
run: | | |
chmod +x ./appium-tests/scripts/run_appium_macos_server.sh | |
./appium-tests/scripts/run_appium_macos_server.sh | |
- name: Validations before starting appium | |
run: | | |
cd appium-tests/apps | |
ls -la | |
cd /Applications/ | |
ls -la | |
- name: Open Application for the first time | |
run: open /Applications/Uplink.app | |
- name: Take screenshot of GH runner | |
uses: OrbitalOwen/[email protected] | |
with: | |
file-name: "desktop.jpg" | |
- name: Quit Application before starting tests | |
run: osascript -e 'quit app "Uplink.app"' | |
- name: Run WebdriverIO tests on MacOS | |
working-directory: ./appium-tests | |
run: npm run mac.ci | |
- name: Upload Screenshots if tests failed 📷 | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: appium-screenshots | |
path: appium-tests/test-results/ios | |
- name: Upload Appium Log if tests failed 📷 | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: appium-log | |
path: appium-tests/appium.log |