Repository navigation
67 lines (67 loc) · 2.56 KB
/
Copy pathmacos.yml
File metadata and controls
67 lines (67 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: macOS validation and packages
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
macos:
strategy:
fail-fast: false
matrix:
include:
- runner: macos-15
arch: arm64
- runner: macos-15-intel
arch: x64
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
env:
MACOSX_DEPLOYMENT_TARGET: '12.0'
RUST_TEST_THREADS: '2'
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Rust
run: rustup toolchain install stable --profile minimal --component rustfmt --component clippy && rustup default stable
- uses: actions/cache/restore@v4
with:
path: |
~/.cargo/registry
target/debug
key: macos-${{ matrix.arch }}-${{ hashFiles('Cargo.lock') }}-${{ github.sha }}
restore-keys: macos-${{ matrix.arch }}-${{ hashFiles('Cargo.lock') }}-
- name: Test
run: |
# Disposable runner only: isolate test secrets from the login keychain.
test_keychain="$RUNNER_TEMP/rshell-tests.keychain-db"
original_keychain=$(security default-keychain -d user | tr -d '"' | xargs)
keychain_password=$(openssl rand -hex 24)
trap 'security default-keychain -d user -s "$original_keychain"; security delete-keychain "$test_keychain"' EXIT
security create-keychain -p "$keychain_password" "$test_keychain"
security list-keychains -d user -s "$test_keychain" "$original_keychain"
security default-keychain -d user -s "$test_keychain"
security unlock-keychain -p "$keychain_password" "$test_keychain"
security set-keychain-settings -lut 3600 "$test_keychain"
# Synthetic test key only: multiple test executables must read it without an ACL dialog.
security add-generic-password -a master-key-v1 -s com.RShell.RShell.file-encryption -w "$(openssl rand -hex 16)" -A "$test_keychain"
bash scripts/test-macos.sh --credentials
- name: Package
run: bash scripts/build-macos.sh ${{ matrix.arch }}
- uses: actions/upload-artifact@v4
with:
name: RShell-macos-${{ matrix.arch }}
path: |
dist/*.zip
dist/*.sha256
if-no-files-found: error
- uses: actions/cache/save@v4
if: always()
with:
path: |
~/.cargo/registry
target/debug
key: macos-${{ matrix.arch }}-${{ hashFiles('Cargo.lock') }}-${{ github.sha }}