-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (84 loc) · 2.52 KB
/
ci.yml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: "CI"
on:
pull_request:
push:
branches:
- "main"
schedule:
- cron: '20 2 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-javascript:
name: "JavaScript Tests"
runs-on: ${{ matrix.os }}
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 }}
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"
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