aboutsummaryrefslogtreecommitdiffhomepage
path: root/.github/workflows
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-12-01 14:14:58 +0100
committerChocobozzz <me@florianbigard.com>2021-12-03 10:14:17 +0100
commit51e9e152f7df003c65c16f822669a0674efcaf03 (patch)
treea18abdf95bfc449d8d08e4c47e8ccc7ee094bbf4 /.github/workflows
parentf3fbbf01402fc7491e044f160edca06ef793eb50 (diff)
downloadPeerTube-51e9e152f7df003c65c16f822669a0674efcaf03.tar.gz
PeerTube-51e9e152f7df003c65c16f822669a0674efcaf03.tar.zst
PeerTube-51e9e152f7df003c65c16f822669a0674efcaf03.zip
Build nightly using github action
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/benchmark.yml69
-rw-r--r--.github/workflows/codeql.yml2
-rw-r--r--.github/workflows/nightly.yml36
-rw-r--r--.github/workflows/stats.yml48
-rw-r--r--.github/workflows/test.yml25
5 files changed, 58 insertions, 122 deletions
diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml
index 86f675432..f02b88a42 100644
--- a/.github/workflows/benchmark.yml
+++ b/.github/workflows/benchmark.yml
@@ -29,48 +29,15 @@ jobs:
29 env: 29 env:
30 PGUSER: peertube 30 PGUSER: peertube
31 PGHOST: localhost 31 PGHOST: localhost
32 NODE_PENDING_JOB_WAIT: 500
33 32
34 steps: 33 steps:
35 - uses: actions/checkout@v2 34 - uses: actions/checkout@v2
36 35
37 - name: Use Node.js 36 - uses: './.github/actions/reusable-prepare-peertube-build'
38 uses: actions/setup-node@v1
39 with: 37 with:
40 node-version: '12.x' 38 node-version: '12.x'
41 39
42 - name: Setup system dependencies 40 - uses: './.github/actions/reusable-prepare-peertube-run'
43 run: |
44 sudo apt-get install postgresql-client-common redis-tools parallel
45 wget --quiet --no-check-certificate "https://download.cpy.re/ffmpeg/ffmpeg-release-4.3.1-64bit-static.tar.xz"
46 tar xf ffmpeg-release-4.3.1-64bit-static.tar.xz
47 mkdir -p $HOME/bin
48 cp ffmpeg-*/{ffmpeg,ffprobe} $HOME/bin
49 echo "$HOME/bin" >> $GITHUB_PATH
50
51 - name: Cache Node.js modules
52 uses: actions/cache@v2
53 with:
54 path: |
55 **/node_modules
56 key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
57 restore-keys: |
58 ${{ runner.OS }}-node-
59 ${{ runner.OS }}-
60
61 - name: Cache fixtures
62 uses: actions/cache@v2
63 with:
64 path: |
65 fixtures
66 key: ${{ runner.OS }}-fixtures-${{ matrix.test_suite }}-${{ hashFiles('fixtures/*') }}
67 restore-keys: |
68 ${{ runner.OS }}-fixtures-${{ matrix.test_suite }}-
69 ${{ runner.OS }}-fixtures-
70 ${{ runner.OS }}-
71
72 - name: Install dependencies
73 run: yarn install --frozen-lockfile
74 41
75 - name: Build 42 - name: Build
76 run: | 43 run: |
@@ -111,27 +78,11 @@ jobs:
111 cat benchmark.json build-time.json startup-time.json 78 cat benchmark.json build-time.json startup-time.json
112 79
113 - name: Upload benchmark result 80 - name: Upload benchmark result
114 env: 81 uses: './.github/actions/reusable-deploy.yml'
115 STATS_DEPLOYEMENT_KNOWN_HOSTS: ${{ secrets.STATS_DEPLOYEMENT_KNOWN_HOSTS }} 82 with:
116 STATS_DEPLOYEMENT_KEY: ${{ secrets.STATS_DEPLOYEMENT_KEY }} 83 source: benchmark.json build-time.json startup-time.json
117 STATS_DEPLOYEMENT_USER: ${{ secrets.STATS_DEPLOYEMENT_USER }} 84 destination: peertube-stats
118 STATS_DEPLOYEMENT_HOST: ${{ secrets.STATS_DEPLOYEMENT_HOST }} 85 knownHosts: ${{ secrets.STATS_DEPLOYEMENT_KNOWN_HOSTS }}
119 run: | 86 deployKey: ${{ secrets.STATS_DEPLOYEMENT_KEY }}
120 mkdir -p ~/.ssh 87 deployUser: ${{ secrets.STATS_DEPLOYEMENT_USER }}
121 chmod 700 ~/.ssh 88 deployHost: ${{ secrets.STATS_DEPLOYEMENT_HOST }}
122 if [ ! -z ${STATS_DEPLOYEMENT_KNOWN_HOSTS+x} ]; then
123 echo "Adding ssh key to known hosts"
124 echo -e "${STATS_DEPLOYEMENT_KNOWN_HOSTS}" > ~/.ssh/known_hosts;
125 fi
126
127 eval `ssh-agent -s`
128
129 if [ ! -z ${STATS_DEPLOYEMENT_KEY+x} ]; then
130 echo "Adding ssh reployement key"
131 ssh-add <(echo "${STATS_DEPLOYEMENT_KEY}");
132 fi
133
134 if [ ! -z ${STATS_DEPLOYEMENT_KEY+x} ]; then
135 echo "Uploading files"
136 scp benchmark.json build-time.json startup-time.json ${STATS_DEPLOYEMENT_USER}@${STATS_DEPLOYEMENT_HOST}:../../web/peertube-stats;
137 fi
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 20803bd86..5c0c93886 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -13,7 +13,7 @@ name: "CodeQL"
13 13
14on: 14on:
15 push: 15 push:
16 branches: [ next ] 16 branches: [ develop, next ]
17 pull_request: 17 pull_request:
18 # The branches below must be a subset of the branches above 18 # The branches below must be a subset of the branches above
19 branches: [ next ] 19 branches: [ next ]
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
new file mode 100644
index 000000000..156b7143a
--- /dev/null
+++ b/.github/workflows/nightly.yml
@@ -0,0 +1,36 @@
1name: Nightly
2
3on:
4 push:
5 branches:
6 - 'next'
7 schedule:
8 - cron: '0 3 * * *'
9
10jobs:
11
12 nightly:
13 runs-on: ubuntu-latest
14
15 steps:
16 -
17 name: Checkout develop
18 uses: actions/checkout@v2
19 with:
20 ref: next
21
22 - uses: './.github/actions/reusable-prepare-peertube-build'
23 with:
24 node-version: '14.x'
25
26 - name: Build
27 run: npm run nightly
28
29 - uses: './.github/actions/reusable-deploy'
30 with:
31 source: ./peertube-nightly-*
32 destination: nightly-test
33 knownHosts: ${{ secrets.STATS_DEPLOYEMENT_KNOWN_HOSTS }}
34 deployKey: ${{ secrets.STATS_DEPLOYEMENT_KEY }}
35 deployUser: ${{ secrets.STATS_DEPLOYEMENT_USER }}
36 deployHost: ${{ secrets.STATS_DEPLOYEMENT_HOST }}
diff --git a/.github/workflows/stats.yml b/.github/workflows/stats.yml
index e50c14720..c87e6fb77 100644
--- a/.github/workflows/stats.yml
+++ b/.github/workflows/stats.yml
@@ -20,24 +20,10 @@ jobs:
20 steps: 20 steps:
21 - uses: actions/checkout@v2 21 - uses: actions/checkout@v2
22 22
23 - name: Use Node.js 23 - uses: './.github/actions/reusable-prepare-peertube-build'
24 uses: actions/setup-node@v1
25 with: 24 with:
26 node-version: '14.x' 25 node-version: '14.x'
27 26
28 - name: Cache Node.js modules
29 uses: actions/cache@v2
30 with:
31 path: |
32 **/node_modules
33 key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
34 restore-keys: |
35 ${{ runner.OS }}-node-
36 ${{ runner.OS }}-
37
38 - name: Install dependencies
39 run: yarn install --frozen-lockfile
40
41 - name: Angular bundlewatch 27 - name: Angular bundlewatch
42 uses: jackyef/bundlewatch-gh-action@master 28 uses: jackyef/bundlewatch-gh-action@master
43 with: 29 with:
@@ -73,27 +59,11 @@ jobs:
73 59
74 - name: Upload stats 60 - name: Upload stats
75 if: github.event_name != 'pull_request' 61 if: github.event_name != 'pull_request'
76 env: 62 uses: './.github/actions/reusable-deploy'
77 STATS_DEPLOYEMENT_KNOWN_HOSTS: ${{ secrets.STATS_DEPLOYEMENT_KNOWN_HOSTS }} 63 with:
78 STATS_DEPLOYEMENT_KEY: ${{ secrets.STATS_DEPLOYEMENT_KEY }} 64 source: lighthouse.json client-build-stats.json scc.json
79 STATS_DEPLOYEMENT_USER: ${{ secrets.STATS_DEPLOYEMENT_USER }} 65 destination: peertube-stats
80 STATS_DEPLOYEMENT_HOST: ${{ secrets.STATS_DEPLOYEMENT_HOST }} 66 knownHosts: ${{ secrets.STATS_DEPLOYEMENT_KNOWN_HOSTS }}
81 run: | 67 deployKey: ${{ secrets.STATS_DEPLOYEMENT_KEY }}
82 mkdir -p ~/.ssh 68 deployUser: ${{ secrets.STATS_DEPLOYEMENT_USER }}
83 chmod 700 ~/.ssh 69 deployHost: ${{ secrets.STATS_DEPLOYEMENT_HOST }}
84 if [ ! -z ${STATS_DEPLOYEMENT_KNOWN_HOSTS+x} ]; then
85 echo "Adding ssh key to known hosts"
86 echo -e "${STATS_DEPLOYEMENT_KNOWN_HOSTS}" > ~/.ssh/known_hosts;
87 fi
88
89 eval `ssh-agent -s`
90
91 if [ ! -z ${STATS_DEPLOYEMENT_KEY+x} ]; then
92 echo "Adding ssh reployement key"
93 ssh-add <(echo "${STATS_DEPLOYEMENT_KEY}");
94 fi
95
96 if [ ! -z ${STATS_DEPLOYEMENT_KEY+x} ]; then
97 echo "Uploading files"
98 scp lighthouse.json client-build-stats.json scc.json ${STATS_DEPLOYEMENT_USER}@${STATS_DEPLOYEMENT_HOST}:../../web/peertube-stats;
99 fi
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 0366ac49f..030ec3790 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -50,29 +50,11 @@ jobs:
50 steps: 50 steps:
51 - uses: actions/checkout@v2 51 - uses: actions/checkout@v2
52 52
53 - name: Use Node.js 53 - uses: './.github/actions/reusable-prepare-peertube-build'
54 uses: actions/setup-node@v1
55 with: 54 with:
56 node-version: '12.x' 55 node-version: '12.x'
57 56
58 - name: Setup system dependencies 57 - uses: './.github/actions/reusable-prepare-peertube-run'
59 run: |
60 sudo apt-get install postgresql-client-common redis-tools parallel
61 wget --quiet --no-check-certificate "https://download.cpy.re/ffmpeg/ffmpeg-release-4.3.1-64bit-static.tar.xz"
62 tar xf ffmpeg-release-4.3.1-64bit-static.tar.xz
63 mkdir -p $HOME/bin
64 cp ffmpeg-*/{ffmpeg,ffprobe} $HOME/bin
65 echo "$HOME/bin" >> $GITHUB_PATH
66
67 - name: Cache Node.js modules
68 uses: actions/cache@v2
69 with:
70 path: |
71 **/node_modules
72 key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
73 restore-keys: |
74 ${{ runner.OS }}-node-
75 ${{ runner.OS }}-
76 58
77 - name: Cache fixtures 59 - name: Cache fixtures
78 uses: actions/cache@v2 60 uses: actions/cache@v2
@@ -85,9 +67,6 @@ jobs:
85 ${{ runner.OS }}-fixtures- 67 ${{ runner.OS }}-fixtures-
86 ${{ runner.OS }}- 68 ${{ runner.OS }}-
87 69
88 - name: Install dependencies
89 run: yarn install --frozen-lockfile
90
91 - name: Set env test variable (schedule) 70 - name: Set env test variable (schedule)
92 if: github.event_name != 'schedule' 71 if: github.event_name != 'schedule'
93 run: | 72 run: |