-
Notifications
You must be signed in to change notification settings - Fork 17
142 lines (133 loc) · 4.44 KB
/
ci-db.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
---
name: Check Collection
on:
schedule:
- cron: '0 21 * * *'
workflow_dispatch:
permissions: write-all
defaults:
run:
shell: bash
jobs:
check_db:
name: Check package collection
runs-on: ubuntu-latest
env:
PACK_DIR: /root/.pack
GOFLAGS: "-buildvcs=false"
strategy:
fail-fast: false
container: ghcr.io/stefan-hoeck/idris2-pack:latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Make output
run: mkdir -p "$HOME/output"
- name: Install dependencies
run: |
apt-get update
apt-get install --yes libgsl-dev
apt-get install --yes libpq-dev
# ncurses-idris:
apt-get install --yes libncurses-dev libc6-dev
# sqlite3:
apt-get install --yes libsqlite3-dev
# idrisGL:
apt-get install --yes libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl2-image-dev libsdl2-ttf-dev libsdl2-gfx-dev libsdl2-mixer-dev
# idris2-go:
apt-get install --yes golang-go
# libuv
apt-get install --yes libuv1-dev
# rtlsdr
apt-get install --yes librtlsdr-dev
# node codegen:
apt-get install --yes nodejs
# spidr ecosystem
apt-get install --yes curl
- name: Use latest pack commit
run: pack update
- name: Install pack-admin
run: pack --no-prompt install-app pack-admin
- name: Copy HEAD
run: cp collections/HEAD.toml "$PACK_DIR/db/HEAD.toml"
- name: Extract Collection from HEAD
run: pack-admin --no-prompt extract-from-head "$PACK_DIR/db/testdb.toml"
- name: Switch Collection
run: pack --no-prompt switch "testdb"
- name: Re-Install pack-admin
run: pack --no-prompt install-app pack-admin
- name: Check Collection
run: pack-admin --no-prompt --with-docs --use-katla check-collection "$HOME/output/"
- name: Save generated files
uses: actions/upload-artifact@master
with:
name: freshly-generated-status
path: ~/output/*
if-no-files-found: error
upload:
name: Upload generated files to main
runs-on: ubuntu-latest
needs:
- check_db
steps:
- name: Checkout pack-db
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Get generated files
uses: actions/download-artifact@master
with:
name: freshly-generated-status
path: ~/output/
- name: Add files
run: |
cp ~/output/STATUS.md STATUS.md
[ -f ~/output/testdb.toml ] && cp ~/output/testdb.toml "collections/nightly-$(date +%y%m%d).toml"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add STATUS.md
git add collections/*
- name: Git commit
run: git commit -m "[ check ] collection update" -m "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
- name: Push changes
if: always()
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
- name: Fail if missing
run: test -f "$HOME/output/testdb.toml"
upload_docs:
name: Upload generated API docs
runs-on: ubuntu-latest
needs:
- check_db
steps:
- name: Checkout pack-db
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
ref: 'docs'
- name: Get generated files
uses: actions/download-artifact@master
with:
name: freshly-generated-status
path: ~/output/
- name: Add files
run: |
cp -a ~/output/docs/* docs
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add docs
- name: Git commit
run: git commit -m "[ docs ] CI docs generation" -m "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
- name: Push changes
if: always()
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: 'docs'
- name: Fail if missing
run: test -f "$HOME/output/testdb.toml"