2020-05-07 06:06:55 +02:00
|
|
|
name: ci
|
|
|
|
|
2021-03-12 18:48:39 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
2020-05-07 06:06:55 +02:00
|
|
|
|
|
|
|
jobs:
|
2020-05-13 01:33:34 +02:00
|
|
|
fmt:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-03-12 18:48:39 +01:00
|
|
|
- uses: actions/checkout@v2
|
2020-05-13 01:33:34 +02:00
|
|
|
- name: Run ./ci/steps/fmt.sh
|
2020-09-15 16:41:47 +02:00
|
|
|
uses: ./ci/images/debian10
|
2020-05-13 01:33:34 +02:00
|
|
|
with:
|
|
|
|
args: ./ci/steps/fmt.sh
|
|
|
|
|
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-03-12 18:48:39 +01:00
|
|
|
- uses: actions/checkout@v2
|
2020-05-13 01:33:34 +02:00
|
|
|
- name: Run ./ci/steps/lint.sh
|
2020-09-15 16:41:47 +02:00
|
|
|
uses: ./ci/images/debian10
|
2020-05-13 01:33:34 +02:00
|
|
|
with:
|
|
|
|
args: ./ci/steps/lint.sh
|
|
|
|
|
2021-04-06 01:32:01 +02:00
|
|
|
audit:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Audit for vulnerabilities
|
|
|
|
uses: ./ci/images/debian10
|
|
|
|
with:
|
|
|
|
args: ./ci/steps/audit.sh
|
|
|
|
|
2021-03-10 00:35:54 +01:00
|
|
|
test-unit:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Run unit tests
|
|
|
|
uses: ./ci/images/debian10
|
|
|
|
with:
|
|
|
|
args: ./ci/steps/test-unit.sh
|
|
|
|
test-e2e:
|
2021-01-28 00:04:37 +01:00
|
|
|
needs: linux-amd64
|
2020-05-08 02:44:32 +02:00
|
|
|
runs-on: ubuntu-latest
|
2021-01-29 00:23:55 +01:00
|
|
|
env:
|
|
|
|
PASSWORD: e45432jklfdsab
|
|
|
|
CODE_SERVER_ADDRESS: http://localhost:8080
|
2020-05-07 06:06:55 +02:00
|
|
|
steps:
|
2021-03-12 18:48:39 +01:00
|
|
|
- uses: actions/checkout@v2
|
2021-01-28 00:04:37 +01:00
|
|
|
- name: Download release packages
|
|
|
|
uses: actions/download-artifact@v2
|
2020-05-08 02:44:32 +02:00
|
|
|
with:
|
2021-01-28 00:04:37 +01:00
|
|
|
name: release-packages
|
|
|
|
path: ./release-packages
|
|
|
|
- name: Untar code-server file
|
|
|
|
run: |
|
|
|
|
cd release-packages && tar -xzf code-server*-linux-amd64.tar.gz
|
|
|
|
- uses: microsoft/playwright-github-action@v1
|
2021-03-10 00:36:56 +01:00
|
|
|
- name: Install dependencies and run end-to-end tests
|
2021-01-28 00:04:37 +01:00
|
|
|
run: |
|
2021-04-03 01:02:49 +02:00
|
|
|
./release-packages/code-server*-linux-amd64/bin/code-server --log trace &
|
2021-01-28 00:04:37 +01:00
|
|
|
yarn --frozen-lockfile
|
2021-03-10 00:36:56 +01:00
|
|
|
yarn test:e2e
|
2021-02-02 22:29:02 +01:00
|
|
|
- name: Upload test artifacts
|
2021-03-05 18:28:37 +01:00
|
|
|
if: always()
|
2021-02-02 22:29:02 +01:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: test-videos
|
2021-03-10 00:36:56 +01:00
|
|
|
path: ./test/e2e/videos
|
2021-03-01 23:46:16 +01:00
|
|
|
- name: Remove release packages and test artifacts
|
2021-03-10 00:35:54 +01:00
|
|
|
run: rm -rf ./release-packages ./test/e2e/videos
|
2020-05-08 02:44:32 +02:00
|
|
|
|
2020-05-08 05:48:49 +02:00
|
|
|
release:
|
2020-05-08 02:44:32 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-03-12 18:48:39 +01:00
|
|
|
- uses: actions/checkout@v2
|
2020-05-08 02:44:32 +02:00
|
|
|
- name: Run ./ci/steps/release.sh
|
2020-09-15 16:41:47 +02:00
|
|
|
uses: ./ci/images/debian10
|
2020-05-08 02:44:32 +02:00
|
|
|
with:
|
|
|
|
args: ./ci/steps/release.sh
|
|
|
|
- name: Upload npm package artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: npm-package
|
2020-05-18 19:48:45 +02:00
|
|
|
path: ./release-npm-package
|
2020-05-08 02:44:32 +02:00
|
|
|
|
2020-05-08 05:48:49 +02:00
|
|
|
linux-amd64:
|
|
|
|
needs: release
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-03-12 18:48:39 +01:00
|
|
|
- uses: actions/checkout@v2
|
2020-05-08 05:48:49 +02:00
|
|
|
- name: Download npm package
|
2020-05-08 06:34:20 +02:00
|
|
|
uses: actions/download-artifact@v2
|
2020-05-08 05:48:49 +02:00
|
|
|
with:
|
|
|
|
name: npm-package
|
2020-05-18 19:48:45 +02:00
|
|
|
path: ./release-npm-package
|
2020-05-28 00:04:36 +02:00
|
|
|
- name: Run ./ci/steps/release-packages.sh
|
2020-06-03 18:14:55 +02:00
|
|
|
uses: ./ci/images/centos7
|
2020-05-08 05:48:49 +02:00
|
|
|
with:
|
2020-05-28 00:04:36 +02:00
|
|
|
args: ./ci/steps/release-packages.sh
|
2020-05-08 05:48:49 +02:00
|
|
|
- name: Upload release artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2020-05-08 06:34:20 +02:00
|
|
|
name: release-packages
|
|
|
|
path: ./release-packages
|
2020-05-08 05:48:49 +02:00
|
|
|
|
2020-05-08 02:44:32 +02:00
|
|
|
linux-arm64:
|
2020-05-08 05:48:49 +02:00
|
|
|
needs: release
|
2020-05-08 02:44:32 +02:00
|
|
|
runs-on: ubuntu-arm64-latest
|
|
|
|
steps:
|
2021-03-12 18:48:39 +01:00
|
|
|
- uses: actions/checkout@v2
|
2020-05-08 05:48:49 +02:00
|
|
|
- name: Download npm package
|
2020-05-08 06:34:20 +02:00
|
|
|
uses: actions/download-artifact@v2
|
2020-05-08 05:48:49 +02:00
|
|
|
with:
|
|
|
|
name: npm-package
|
2020-05-18 19:48:45 +02:00
|
|
|
path: ./release-npm-package
|
2020-05-28 00:04:36 +02:00
|
|
|
- name: Run ./ci/steps/release-packages.sh
|
2020-06-03 18:14:55 +02:00
|
|
|
uses: ./ci/images/centos7
|
2020-05-08 02:44:32 +02:00
|
|
|
with:
|
2020-05-28 00:04:36 +02:00
|
|
|
args: ./ci/steps/release-packages.sh
|
2020-05-08 02:44:32 +02:00
|
|
|
- name: Upload release artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2020-05-08 06:34:20 +02:00
|
|
|
name: release-packages
|
|
|
|
path: ./release-packages
|
2021-03-01 23:50:07 +01:00
|
|
|
- name: Remove docker images
|
2021-03-02 00:57:02 +01:00
|
|
|
run: docker system prune -af
|
2020-05-08 02:44:32 +02:00
|
|
|
|
2020-05-08 07:42:46 +02:00
|
|
|
macos-amd64:
|
2020-05-08 05:48:49 +02:00
|
|
|
needs: release
|
2020-05-08 02:44:32 +02:00
|
|
|
runs-on: macos-latest
|
2021-03-12 18:48:39 +01:00
|
|
|
# This job requires secrets, so can only run on the default branch
|
|
|
|
if: github.ref == 'refs/heads/main'
|
2020-05-08 02:44:32 +02:00
|
|
|
steps:
|
2021-03-12 18:48:39 +01:00
|
|
|
- uses: actions/checkout@v2
|
2020-05-08 05:48:49 +02:00
|
|
|
- name: Download npm package
|
2020-05-08 06:34:20 +02:00
|
|
|
uses: actions/download-artifact@v2
|
2020-05-08 05:48:49 +02:00
|
|
|
with:
|
|
|
|
name: npm-package
|
2020-05-18 19:48:45 +02:00
|
|
|
path: ./release-npm-package
|
2020-05-28 00:04:36 +02:00
|
|
|
- run: ./ci/steps/release-packages.sh
|
2020-05-08 02:44:32 +02:00
|
|
|
env:
|
2020-05-08 05:48:49 +02:00
|
|
|
# Otherwise we get rate limited when fetching the ripgrep binary.
|
2020-05-08 22:31:42 +02:00
|
|
|
# For whatever reason only MacOS needs it.
|
2020-05-08 09:08:30 +02:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2020-05-08 02:44:32 +02:00
|
|
|
- name: Upload release artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
2020-05-07 06:06:55 +02:00
|
|
|
with:
|
2020-05-08 06:34:20 +02:00
|
|
|
name: release-packages
|
|
|
|
path: ./release-packages
|
2020-05-16 16:55:46 +02:00
|
|
|
|
|
|
|
docker-amd64:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: linux-amd64
|
|
|
|
steps:
|
2021-03-12 18:48:39 +01:00
|
|
|
- uses: actions/checkout@v2
|
2020-05-16 16:55:46 +02:00
|
|
|
- name: Download release package
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: release-packages
|
|
|
|
path: ./release-packages
|
|
|
|
- name: Run ./ci/steps/build-docker-image.sh
|
2020-09-15 16:41:47 +02:00
|
|
|
uses: ./ci/images/debian10
|
2020-05-16 16:55:46 +02:00
|
|
|
with:
|
|
|
|
args: ./ci/steps/build-docker-image.sh
|
|
|
|
- name: Upload release image
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: release-images
|
|
|
|
path: ./release-images
|
|
|
|
|
|
|
|
docker-arm64:
|
|
|
|
runs-on: ubuntu-arm64-latest
|
|
|
|
needs: linux-arm64
|
|
|
|
steps:
|
2021-03-12 18:48:39 +01:00
|
|
|
- uses: actions/checkout@v2
|
2020-05-16 16:55:46 +02:00
|
|
|
- name: Download release package
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: release-packages
|
|
|
|
path: ./release-packages
|
|
|
|
- name: Run ./ci/steps/build-docker-image.sh
|
2020-06-03 22:22:59 +02:00
|
|
|
uses: ./ci/images/centos7
|
2020-05-16 16:55:46 +02:00
|
|
|
with:
|
|
|
|
args: ./ci/steps/build-docker-image.sh
|
|
|
|
- name: Upload release image
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: release-images
|
|
|
|
path: ./release-images
|