1
0
mirror of https://github.com/coder/code-server.git synced 2024-12-05 07:13:06 +08:00
code-server/.github/workflows/ci.yaml

179 lines
5.0 KiB
YAML
Raw Normal View History

2020-05-07 12:06:55 +08:00
name: ci
on:
push:
branches:
- main
pull_request:
branches:
- main
2020-05-07 12:06:55 +08:00
jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run ./ci/steps/fmt.sh
uses: ./ci/images/debian10
with:
args: ./ci/steps/fmt.sh
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run ./ci/steps/lint.sh
uses: ./ci/images/debian10
with:
args: ./ci/steps/lint.sh
2020-05-08 08:44:32 +08:00
test:
2021-01-28 07:04:37 +08:00
needs: linux-amd64
2020-05-08 08:44:32 +08:00
runs-on: ubuntu-latest
env:
PASSWORD: e45432jklfdsab
CODE_SERVER_ADDRESS: http://localhost:8080
2020-05-07 12:06:55 +08:00
steps:
- uses: actions/checkout@v2
2021-01-28 07:04:37 +08:00
- name: Download release packages
uses: actions/download-artifact@v2
2020-05-08 08:44:32 +08:00
with:
2021-01-28 07:04:37 +08: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
- name: Install dependencies and run tests
run: |
2021-02-02 05:40:06 +08:00
./release-packages/code-server*-linux-amd64/bin/code-server --home $CODE_SERVER_ADDRESS/healthz &
2021-01-28 07:04:37 +08:00
yarn --frozen-lockfile
yarn test
2021-02-03 05:29:02 +08:00
- name: Upload test artifacts
if: always()
2021-02-03 05:29:02 +08:00
uses: actions/upload-artifact@v2
with:
name: test-videos
path: ./test/videos
- name: Remove release packages and test artifacts
run: rm -rf ./release-packages ./test/videos
2020-05-08 08:44:32 +08:00
release:
2020-05-08 08:44:32 +08:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
2020-05-08 08:44:32 +08:00
- name: Run ./ci/steps/release.sh
uses: ./ci/images/debian10
2020-05-08 08:44:32 +08:00
with:
args: ./ci/steps/release.sh
- name: Upload npm package artifact
uses: actions/upload-artifact@v2
with:
name: npm-package
path: ./release-npm-package
2020-05-08 08:44:32 +08:00
linux-amd64:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download npm package
uses: actions/download-artifact@v2
with:
name: npm-package
path: ./release-npm-package
2020-05-28 06:04:36 +08:00
- name: Run ./ci/steps/release-packages.sh
2020-06-04 00:14:55 +08:00
uses: ./ci/images/centos7
with:
2020-05-28 06:04:36 +08:00
args: ./ci/steps/release-packages.sh
- name: Upload release artifacts
uses: actions/upload-artifact@v2
with:
name: release-packages
path: ./release-packages
2020-05-08 08:44:32 +08:00
linux-arm64:
needs: release
2020-05-08 08:44:32 +08:00
runs-on: ubuntu-arm64-latest
steps:
- uses: actions/checkout@v2
- name: Download npm package
uses: actions/download-artifact@v2
with:
name: npm-package
path: ./release-npm-package
2020-05-28 06:04:36 +08:00
- name: Run ./ci/steps/release-packages.sh
2020-06-04 00:14:55 +08:00
uses: ./ci/images/centos7
2020-05-08 08:44:32 +08:00
with:
2020-05-28 06:04:36 +08:00
args: ./ci/steps/release-packages.sh
2020-05-08 08:44:32 +08:00
- name: Upload release artifacts
uses: actions/upload-artifact@v2
with:
name: release-packages
path: ./release-packages
- name: Remove docker images
run: docker system prune -af
2020-05-08 08:44:32 +08:00
2020-05-08 13:42:46 +08:00
macos-amd64:
needs: release
2020-05-08 08:44:32 +08:00
runs-on: macos-latest
# This job requires secrets, so can only run on the default branch
if: github.ref == 'refs/heads/main'
2020-05-08 08:44:32 +08:00
steps:
- uses: actions/checkout@v2
- name: Download npm package
uses: actions/download-artifact@v2
with:
name: npm-package
path: ./release-npm-package
2020-05-28 06:04:36 +08:00
- run: ./ci/steps/release-packages.sh
2020-05-08 08:44:32 +08:00
env:
# Otherwise we get rate limited when fetching the ripgrep binary.
2020-05-09 04:31:42 +08:00
# For whatever reason only MacOS needs it.
2020-05-08 15:08:30 +08:00
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2020-05-08 08:44:32 +08:00
- name: Upload release artifacts
uses: actions/upload-artifact@v2
2020-05-07 12:06:55 +08:00
with:
name: release-packages
path: ./release-packages
docker-amd64:
runs-on: ubuntu-latest
needs: linux-amd64
steps:
- uses: actions/checkout@v2
- name: Download release package
uses: actions/download-artifact@v2
with:
name: release-packages
path: ./release-packages
- name: Run ./ci/steps/build-docker-image.sh
uses: ./ci/images/debian10
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:
- uses: actions/checkout@v2
- 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-04 04:22:59 +08:00
uses: ./ci/images/centos7
with:
args: ./ci/steps/build-docker-image.sh
- name: Upload release image
uses: actions/upload-artifact@v2
with:
name: release-images
path: ./release-images