diff options
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/benchmark.yml | 69 | ||||
-rw-r--r-- | .github/workflows/codeql.yml | 68 | ||||
-rw-r--r-- | .github/workflows/codeql/codeql-config.yml | 4 | ||||
-rw-r--r-- | .github/workflows/docker.yml | 70 | ||||
-rw-r--r-- | .github/workflows/nightly.yml | 33 | ||||
-rw-r--r-- | .github/workflows/stats.yml | 50 | ||||
-rw-r--r-- | .github/workflows/test.yml | 27 |
7 files changed, 198 insertions, 123 deletions
diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 86f675432..7e8259d27 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' |
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 new file mode 100644 index 000000000..8764cdd0e --- /dev/null +++ b/.github/workflows/codeql.yml | |||
@@ -0,0 +1,68 @@ | |||
1 | # For most projects, this workflow file will not need changing; you simply need | ||
2 | # to commit it to your repository. | ||
3 | # | ||
4 | # You may wish to alter this file to override the set of languages analyzed, | ||
5 | # or to provide custom queries or build logic. | ||
6 | # | ||
7 | # ******** NOTE ******** | ||
8 | # We have attempted to detect the languages in your repository. Please check | ||
9 | # the `language` matrix defined below to confirm you have the correct set of | ||
10 | # supported CodeQL languages. | ||
11 | # | ||
12 | name: "CodeQL" | ||
13 | |||
14 | on: | ||
15 | push: | ||
16 | branches: [ develop, next ] | ||
17 | schedule: | ||
18 | - cron: '36 9 * * 5' | ||
19 | |||
20 | jobs: | ||
21 | analyze: | ||
22 | name: Analyze | ||
23 | runs-on: ubuntu-latest | ||
24 | permissions: | ||
25 | actions: read | ||
26 | contents: read | ||
27 | security-events: write | ||
28 | |||
29 | strategy: | ||
30 | fail-fast: false | ||
31 | matrix: | ||
32 | language: [ 'javascript' ] | ||
33 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] | ||
34 | # Learn more about CodeQL language support at https://git.io/codeql-language-support | ||
35 | |||
36 | steps: | ||
37 | - name: Checkout repository | ||
38 | uses: actions/checkout@v2 | ||
39 | |||
40 | # Initializes the CodeQL tools for scanning. | ||
41 | - name: Initialize CodeQL | ||
42 | uses: github/codeql-action/init@v1 | ||
43 | with: | ||
44 | languages: ${{ matrix.language }} | ||
45 | config-file: ./.github/workflows/codeql/codeql-config.yml | ||
46 | # If you wish to specify custom queries, you can do so here or in a config file. | ||
47 | # By default, queries listed here will override any specified in a config file. | ||
48 | # Prefix the list here with "+" to use these queries and those in the config file. | ||
49 | # queries: ./path/to/local/query, your-org/your-repo/queries@main | ||
50 | |||
51 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
52 | # If this step fails, then you should remove it and run the build manually (see below) | ||
53 | - name: Autobuild | ||
54 | uses: github/codeql-action/autobuild@v1 | ||
55 | |||
56 | # âšī¸ Command-line programs to run using the OS shell. | ||
57 | # đ https://git.io/JvXDl | ||
58 | |||
59 | # âī¸ If the Autobuild fails above, remove it and uncomment the following three lines | ||
60 | # and modify them (or add more) to build your code if your project | ||
61 | # uses a compiled language | ||
62 | |||
63 | #- run: | | ||
64 | # make bootstrap | ||
65 | # make release | ||
66 | |||
67 | - name: Perform CodeQL Analysis | ||
68 | uses: github/codeql-action/analyze@v1 | ||
diff --git a/.github/workflows/codeql/codeql-config.yml b/.github/workflows/codeql/codeql-config.yml new file mode 100644 index 000000000..8b771ae99 --- /dev/null +++ b/.github/workflows/codeql/codeql-config.yml | |||
@@ -0,0 +1,4 @@ | |||
1 | name: "PeerTube CodeQL config" | ||
2 | |||
3 | paths-ignore: | ||
4 | - server/tests | ||
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 000000000..7afe641b3 --- /dev/null +++ b/.github/workflows/docker.yml | |||
@@ -0,0 +1,70 @@ | |||
1 | name: Docker | ||
2 | |||
3 | on: | ||
4 | push: | ||
5 | branches: | ||
6 | - 'master' | ||
7 | schedule: | ||
8 | - cron: '0 3 * * *' | ||
9 | |||
10 | jobs: | ||
11 | generate-matrix: | ||
12 | name: Generate matrix for Docker build | ||
13 | runs-on: ubuntu-latest | ||
14 | outputs: | ||
15 | matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
16 | steps: | ||
17 | - name: Checkout | ||
18 | uses: actions/checkout@v2 | ||
19 | with: | ||
20 | ref: master | ||
21 | - name: Set matrix for build | ||
22 | id: set-matrix | ||
23 | run: | | ||
24 | # FIXME: https://github.com/actions/checkout/issues/290 | ||
25 | git fetch --force --tags | ||
26 | |||
27 | one="{ \"file\": \"./support/docker/production/Dockerfile.bullseye\", \"ref\": \"develop\", \"tags\": \"chocobozzz/peertube:develop-bullseye\" }" | ||
28 | two="{ \"file\": \"./support/docker/production/Dockerfile.buster\", \"ref\": \"master\", \"tags\": \"chocobozzz/peertube:production-buster,chocobozzz/peertube:$(git describe --abbrev=0)-buster\" }" | ||
29 | three="{ \"file\": \"./support/docker/production/Dockerfile.nginx\", \"ref\": \"master\", \"tags\": \"chocobozzz/peertube-webserver:latest\" }" | ||
30 | |||
31 | matrix="[$one,$two,$three]" | ||
32 | echo ::set-output name=matrix::{\"include\":$(echo $matrix)} | ||
33 | |||
34 | docker: | ||
35 | runs-on: ubuntu-latest | ||
36 | |||
37 | needs: generate-matrix | ||
38 | |||
39 | strategy: | ||
40 | matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} | ||
41 | fail-fast: false | ||
42 | |||
43 | steps: | ||
44 | - | ||
45 | name: Set up QEMU | ||
46 | uses: docker/setup-qemu-action@v1 | ||
47 | - | ||
48 | name: Set up Docker Buildx | ||
49 | uses: docker/setup-buildx-action@v1 | ||
50 | - | ||
51 | name: Login to DockerHub | ||
52 | uses: docker/login-action@v1 | ||
53 | with: | ||
54 | username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
55 | password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
56 | |||
57 | - | ||
58 | name: Checkout develop | ||
59 | uses: actions/checkout@v2 | ||
60 | with: | ||
61 | ref: ${{ matrix.ref }} | ||
62 | - | ||
63 | name: Docker build | ||
64 | uses: docker/build-push-action@v2 | ||
65 | with: | ||
66 | context: '.' | ||
67 | platforms: linux/amd64,linux/arm64 | ||
68 | push: true | ||
69 | file: ${{ matrix.file }} | ||
70 | tags: ${{ matrix.tags }} | ||
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 000000000..23898b7ef --- /dev/null +++ b/.github/workflows/nightly.yml | |||
@@ -0,0 +1,33 @@ | |||
1 | name: Nightly | ||
2 | |||
3 | on: | ||
4 | schedule: | ||
5 | - cron: '0 3 * * *' | ||
6 | |||
7 | jobs: | ||
8 | |||
9 | nightly: | ||
10 | runs-on: ubuntu-latest | ||
11 | |||
12 | steps: | ||
13 | - | ||
14 | name: Checkout develop | ||
15 | uses: actions/checkout@v2 | ||
16 | with: | ||
17 | ref: develop | ||
18 | |||
19 | - uses: './.github/actions/reusable-prepare-peertube-build' | ||
20 | with: | ||
21 | node-version: '14.x' | ||
22 | |||
23 | - name: Build | ||
24 | run: npm run nightly | ||
25 | |||
26 | - uses: './.github/actions/reusable-deploy' | ||
27 | with: | ||
28 | source: ./peertube-nightly-* | ||
29 | destination: nightly | ||
30 | knownHosts: ${{ secrets.STATS_DEPLOYEMENT_KNOWN_HOSTS }} | ||
31 | deployKey: ${{ secrets.STATS_DEPLOYEMENT_KEY }} | ||
32 | deployUser: ${{ secrets.STATS_DEPLOYEMENT_USER }} | ||
33 | deployHost: ${{ secrets.STATS_DEPLOYEMENT_HOST }} | ||
diff --git a/.github/workflows/stats.yml b/.github/workflows/stats.yml index e211f6a3b..c87e6fb77 100644 --- a/.github/workflows/stats.yml +++ b/.github/workflows/stats.yml | |||
@@ -1,4 +1,4 @@ | |||
1 | name: "Stats" | 1 | name: Stats |
2 | 2 | ||
3 | on: | 3 | on: |
4 | push: | 4 | push: |
@@ -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 78a9a28c0..030ec3790 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml | |||
@@ -1,4 +1,4 @@ | |||
1 | name: Test Suite | 1 | name: Test |
2 | 2 | ||
3 | on: | 3 | on: |
4 | push: | 4 | push: |
@@ -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: | |