diff --git a/.github/workflows/check-config.yml b/.github/workflows/check-config.yml index 5b3af314..1ee8aab6 100644 --- a/.github/workflows/check-config.yml +++ b/.github/workflows/check-config.yml @@ -1,4 +1,4 @@ -on: +on: pull_request: paths: - 'configs/*.json' @@ -8,8 +8,6 @@ name: Check Config jobs: check-config: runs-on: ubuntu-latest - outputs: - targets: ${{ steps.set-matrix.outputs.targets }} steps: - uses: actions/checkout@v2 - name: check if config files are sorted alphabetically diff --git a/.github/workflows/check-yaml.yml b/.github/workflows/check-yaml.yml new file mode 100644 index 00000000..b02dc279 --- /dev/null +++ b/.github/workflows/check-yaml.yml @@ -0,0 +1,23 @@ +on: + pull_request: + paths: + - '**/action.yml' + - '**/action.yaml' + - '**/.github/workflows/*.yml' + - '**/.github/workflows/*.yaml' + +name: Check YAML + +jobs: + check-yaml: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + # TODO: switch to mainline once https://github.com/nwisbeta/validate-yaml-schema/pull/21 is merged + - uses: galargh/validate-yaml-schema@c8060d4a389d0eec986a90665bf0c496bf1f52e8 + with: + yamlSchemasJson: | + { + "https://json.schemastore.org/github-action.json": ["**/action.yml", "**/action.yaml"], + "https://json.schemastore.org/github-workflow.json": ["**/.github/workflows/*.yml", "**/.github/workflows/*.yaml"] + } diff --git a/README.md b/README.md index 9159f46c..3b66715c 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Some repositories may require some pre-setup steps to be run before tests (or co runs: using: "composite" steps: - - name: Step 1 + - name: Step 1 shell: bash run: echo "do some initial setup" - name: Step 2 @@ -60,5 +60,11 @@ If you want your project to participle, please send a PR! ## Development +### Branches + The `master` branch contains currently deployed workflows. When we make minor changes to these workflows, we don't always want these changes to get deployed to all hundreds of repositories, as this creates a lot of unnecessary noise. Minor changes to the workflows are therefore merged into the [`next`](https://github.com/protocol/.github/tree/next) branch. When the time has come, we create a PR from the `next` branch to `master` to trigger a deployment to all repositores. + +### IDE + +If you're using [Visual Studio Code](https://code.visualstudio.com/) for development, you might want to install the [YAML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension. It is configured to perform GitHub workflow/action linting out-of-the-box. If you're using a different IDE, you can check if a [client](https://github.com/redhat-developer/yaml-language-server#clients) for it exists. diff --git a/templates/.github/workflows/go-test.yml b/templates/.github/workflows/go-test.yml index 01294752..e5b67a53 100644 --- a/templates/.github/workflows/go-test.yml +++ b/templates/.github/workflows/go-test.yml @@ -10,8 +10,8 @@ jobs: go: [ "1.16.x", "1.17.x" ] env: COVERAGES: "" - runs-on: ${{ matrix.os }}-latest - name: ${{ matrix.os}} (go ${{ matrix.go }}) + runs-on: ${{ format('${0}-latest', matrix.os) }} + name: ${{ matrix.os }} (go ${{ matrix.go }}) steps: - uses: actions/checkout@v2 with: