CI #693
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" | |
on: | |
pull_request: | |
push: | |
branches: | |
- "main" | |
schedule: | |
- cron: '20 2 * * *' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
FLOX_DISABLE_METRICS: "true" | |
jobs: | |
test-javascript: | |
name: "JavaScript Tests" | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 30 | |
strategy: | |
matrix: | |
os: | |
- "ubuntu-latest" | |
- "macos-latest" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
- name: "Install Nix" | |
uses: "cachix/install-nix-action@V27" | |
- name: "Cache Dependencies" | |
id: cache | |
uses: "actions/cache@8070854e57d983bdd2887b0a708ad985f77398ab" | |
env: | |
GITHUB_ACTIONS_RUNNER_FORCED_NODE_VERSION: node20 | |
with: | |
key: npm-${{ matrix.os }}-${{ hashFiles('package-lock.json') }} | |
path: ./node_modules | |
restore-keys: | | |
npm-feature-${{ matrix.os }}-${{ hashFiles('package-lock.json') }} | |
npm-feature-${{ matrix.os }}- | |
npm-feature- | |
npm- | |
- name: "Install Dependencies" | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: nix develop --command npm ci | |
- name: "Check Format" | |
run: nix develop --command npm run format:check | |
- name: "Test" | |
run: nix develop --command npm run ci-test | |
test-action: | |
name: "Github Action Test" | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 30 | |
strategy: | |
matrix: | |
os: | |
- "ubuntu-latest" | |
- "macos-latest" | |
release-env: | |
- stable | |
- nightly | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
- name: "Test Local Action" | |
uses: "./" | |
with: | |
channel: "${{ matrix.release-env }}" | |
- name: "Test: flox --version" | |
run: | | |
flox --version | |
report-failure: | |
name: "Report Failure" | |
runs-on: "ubuntu-latest" | |
timeout-minutes: 30 | |
if: ${{ failure() && github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'schedule') }} | |
needs: | |
- "test-javascript" | |
- "test-action" | |
steps: | |
- name: "Slack Notification" | |
uses: "rtCamp/action-slack-notify@v2" | |
env: | |
SLACK_TITLE: "Something broke CI for flox/flox on main" | |
SLACK_FOOTER: "Thank you for caring" | |
SLACK_WEBHOOK: "${{ secrets.MANAGED_SLACK_WEBHOOK }}" | |
SLACK_USERNAME: "GitHub" | |
SLACK_ICON_EMOJI: ":poop:" | |
SLACK_COLOR: "#ff2800" # ferrari red -> https://encycolorpedia.com/ff2800 | |
SLACK_LINK_NAMES: true |