Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate test pipelines to gh #339

Merged
merged 2 commits into from
Jul 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: ci

on:
push:
branches: [main]
pull_request:

jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target-folder: drop-linux
- os: windows-latest
target-folder: drop

steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: "20"

- name: npm ci
run: npm ci

- name: lint
run: npm run lint

- name: prettier
run: npm run prettier

- name: test
run: npm test

- name: pack
run: npm pack

- name: Copy Files to target-folder
run: mkdir -p ${{ matrix.target-folder }} && cp *.tgz ${{ matrix.target-folder }}

- name: Upload Artifact
uses: actions/upload-artifact@v2
Copy link

@konrad-jamrozik konrad-jamrozik Jul 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @v2 of actions/upload-artifact is deprecated since 6/30/2024, i.e. yesterday:

https://github.com/actions/upload-artifact#actionsupload-artifact

I can fix it in a future PR.

with:
name: ${{ matrix.target-folder }}
path: ${{ matrix.target-folder }}
Comment on lines +38 to +48

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the benefit of doing npm pack and the remaining steps?

I think they may have made sense in the context of uploading tests results to Azure DevOps pipeline and/or publishing the package, but if we make this GH action go up to test and no later, will uploading artifacts help? Will it somehow integrate with GitHub UI for nice test viewing experience or similar? If not, perhaps we can remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it does!

Example here in a repo I also maintain: https://github.com/gitify-app/gitify/actions/runs/9626236252

You can see all of the artifacts of a given workflow, which is something that I'd say would be nice to keep!