fix: Cache Functionality Fixes and Comprehensive Test Suite (#91) #157
This file contains hidden or 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: Pull Request Build and Test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
macos-latest: | |
# macOS-latest images are not the most recent | |
# The vast majority of macOS developers would be using the latest version of macOS | |
# Current list here: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners | |
runs-on: macOS-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check for FLAGSMITH_TEST_API_KEY | |
run: | | |
if [ -z "$FLAGSMITH_TEST_API_KEY" ]; then | |
echo "Warning: FLAGSMITH_TEST_API_KEY environment variable is not set" | |
exit 1 | |
fi | |
env: | |
FLAGSMITH_TEST_API_KEY: ${{ secrets.FLAGSMITH_TEST_API_KEY }} | |
- name: Build (macOS) | |
run: swift --version && swift build | |
- name: Run tests | |
run: swift test | |
env: | |
FLAGSMITH_TEST_API_KEY: ${{ secrets.FLAGSMITH_TEST_API_KEY }} | |
swift-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check for FLAGSMITH_TEST_API_KEY | |
run: | | |
if [ -z "$FLAGSMITH_TEST_API_KEY" ]; then | |
echo "Warning: FLAGSMITH_TEST_API_KEY environment variable is not set" | |
exit 1 | |
fi | |
env: | |
FLAGSMITH_TEST_API_KEY: ${{ secrets.FLAGSMITH_TEST_API_KEY }} | |
- name: Run SwiftLint | |
uses: norio-nomura/[email protected] | |
# TODO: enable these settings: | |
# env: | |
# DIFF_BASE: ${{ github.base_ref }} | |
# with: | |
# args: --strict |