Archived
1
0
This repository has been archived on 2024-09-09. You can view files and clone it, but cannot push or open issues or pull requests.
code-server/.github/workflows/scripts.yaml

68 lines
1.5 KiB
YAML
Raw Normal View History

2021-07-13 19:22:00 +02:00
name: Script unit tests
on:
push:
branches:
- main
paths:
- "**.sh"
- "**.bats"
2021-07-13 19:22:00 +02:00
pull_request:
branches:
- main
paths:
- "**.sh"
- "**.bats"
2021-07-13 19:22:00 +02:00
permissions:
actions: none
checks: none
contents: read
deployments: none
issues: none
packages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none
# Cancel in-progress runs for pull requests when developers push
# additional changes, and serialize builds in branches.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
2021-07-13 19:22:00 +02:00
jobs:
test:
name: Run script unit tests
runs-on: ubuntu-latest
# This runs on Alpine to make sure we're testing with actual sh.
container: "alpine:3.17"
2021-07-13 19:22:00 +02:00
steps:
- name: Checkout repo
uses: actions/checkout@v3
2021-07-13 19:22:00 +02:00
2021-07-13 19:24:30 +02:00
- name: Install test utilities
run: apk add bats checkbashisms
- name: Check Bashisms
run: checkbashisms ./install.sh
2021-07-13 19:22:00 +02:00
- name: Run script unit tests
run: ./ci/dev/test-scripts.sh
feat(ci): refactor build workflow (#5572) * refactor: remove stylelint * refactor: move shellcheck to separate job * refactor: add helm script and job * refactor: add eslint job and yarn script * fix(test/tsconfig): exclude test-plugin * refactor: delete lint, add typecheck job * refactor: remove prebuild * wip: add notes about unit test refactor * refactor: delete buggy socket test This test was really added to in get cover specific lines but it's buggy and only passes sometimes locally. I think it's okay to remove because: - it's an implementation detail (not user facing) - not preventing any specific regressions * refactor: move test-plugin to integration suite This seems more appropriate given this tests how a plugin might work within code-server. * wip * wip: refactor vscode integration tests * refactor: move unit tests to separate job * fix: formatting * Revert "wip: refactor vscode integration tests" This reverts commit 13286bf4c9762b7d6c6176464d94b1fc316fb568. * Revert "refactor: move unit tests to separate job" This reverts commit 6c87b540b49c8d56266c8925c4fd32ed760b23bf. * feat: collect codecov integration tests * fixup! feat: collect codecov integration tests * fixup! feat: collect codecov integration tests * fixup!: move helm step * fixup!: update ids for caching * trigger ci * trigger ci * chore: clean up names in security.yaml * fixup!: remove .tsx * fixup!: change to src/**" * fixup!: move helm cmd to yaml * fixup!: always build test plugin * fixup!: fix plugin typings * fixup! add back flakey test * fixup!: only install helm deps if changes * fixup!: revert node mod caching * dont keep, test for asher * fixup!: add make to centos * refactor: add test:native This adds a new script to run native tests (i.e. --help which should run in ci on all platforms). * try updating glibc * try 2.25 * Revert "refactor: move test-plugin to integration suite" This reverts commit bc02005dc097a10b5216b616ff0bd7a911240748. I couldn't get past some GLIBC errors in CI so moving back to unit tests. * Revert "try updating glibc" This reverts commit 02ed560f223a8505cb5e6e2014055cb256a407b0. * fixup! * asher: again * try this for ts changes * fixup * refactor: scripts.yml -> scripts.yaml * fixup!: move lint-sh to scripts.yaml * fixup!: use apk for lint scripts * fixup! fixup!: use apk for lint scripts * fixup!: remove typecheck step * fix: pattern for lint ts files * test: lint should fail * fixup! fixup!: use apk for lint scripts * Revert "test: lint should fail" This reverts commit 158c64db044c24f2f8ffd082cc769f06876d6957. * fixup!: skip cancel workflow on forks Looks like the cancel action workflow can't run on forks due to secrets. See https://github.com/andymckay/cancel-action/issues/4 * fixup: remove cancel-workflow * fixup! fixup! fixup!: use apk for lint scripts * fixup! fixup! fixup!: use apk for lint scripts * fixup!: fix yarn key * fixup!: add fetch-depth 0
2022-09-22 21:33:32 +02:00
lint:
name: Lint shell files
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install lint utilities
run: sudo apt install shellcheck
- name: Lint shell files
run: ./ci/dev/lint-scripts.sh