ci(workflows): add dependencies for release job in test.yaml #120
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| description: | | |
| This workflow runs tests for devcontainer features and | |
| creates a new release if changes are detected. | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| test-autogenerated: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| feature: ${{fromJson(vars.FEATURES_JSON)}} | |
| base-image: | |
| - archlinux:latest | |
| - archlinux:base | |
| - archlinux:base-devel | |
| - archlinux:multilib-devel | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: "Install Dependencies" | |
| run: yarn global add @devcontainers/cli | |
| - name: "Generating tests for '${{ matrix.feature }}' against '${{ matrix.base-image }}'" | |
| run: make FEATURES=${{ matrix.feature }} BASE_IMAGE=${{ matrix.base-image }} test-autogenerated | |
| test-scenarios: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| feature: ${{fromJson(vars.FEATURES_JSON)}} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: "Install Dependencies" | |
| run: yarn global add @devcontainers/cli | |
| - name: "Generating tests for '${{ matrix.feature }}' scenarios" | |
| run: make FEATURES=${{ matrix.feature }} test-scenarios | |
| test-global: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: "Install Dependencies" | |
| run: yarn global add @devcontainers/cli | |
| - name: "Testing global scenarios" | |
| run: make test-global | |
| release: | |
| name: Release | |
| if: github.event_name == 'push' | |
| needs: [test-autogenerated, test-scenarios, test-global] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| issues: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: bartventer/devcontainer-images/.github/actions/setup-node@v2.3.0 | |
| - name: Import GPG key | |
| uses: crazy-max/ghaction-import-gpg@v6 | |
| with: | |
| gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
| - name: Run semantic-release | |
| run: yarn run semantic-release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |