-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9cb69ac
commit 9f749af
Showing
28 changed files
with
1,658 additions
and
1,485 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.git | ||
.github | ||
.gitignore | ||
.idea | ||
.vscode | ||
.devcontainer | ||
.prettierrc.json | ||
CHANGELOG.md | ||
fake_collection | ||
node_modules | ||
coverage |
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
name: Testing the Action | ||
|
||
on: [pull_request] | ||
|
||
env: | ||
RUNNER_TEMP: /tmp | ||
TEST_ARTIFACT_VERSION: 0.0.14 | ||
|
||
jobs: | ||
local_tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: .node-version | ||
cache: 'npm' | ||
check-latest: true | ||
|
||
- name: Install Dependencies | ||
run: npm ci | ||
|
||
- name: Check Format | ||
run: npm run format-check | ||
|
||
- name: Run tests | ||
run: npm test | ||
|
||
test_deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- name: Set up action.yml | ||
run: cp action_ci.yml action.yml | ||
|
||
- name: Test the action | ||
uses: ./ | ||
with: | ||
api_key: '${{ secrets.GALAXY_API_KEY }}' | ||
# Fake location that's a small amount of content | ||
collection_dir: 'tests/collection' | ||
|
||
- name: Test the action with a custom version | ||
uses: ./ | ||
with: | ||
api_key: '${{ secrets.GALAXY_API_KEY }}' | ||
collection_dir: 'tests/collection' | ||
# Custom version | ||
galaxy_version: '${{ env.TEST_ARTIFACT_VERSION }}-test' | ||
|
||
test_build_then_publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- name: Set up action.yml | ||
run: cp tests/action.yml action.yml | ||
|
||
- name: Test the action - only build | ||
uses: ./ | ||
with: | ||
api_key: '${{ secrets.GALAXY_API_KEY }}' | ||
collection_dir: 'tests/collection' | ||
# Different from above version | ||
galaxy_version: '${{ env.TEST_ARTIFACT_VERSION }}-build' | ||
build: true | ||
publish: false | ||
|
||
- name: Test the action - only publish | ||
uses: ./ | ||
with: | ||
api_key: '${{ secrets.GALAXY_API_KEY }}' | ||
collection_dir: 'tests/collection' | ||
# Should match version above | ||
galaxy_version: '${{ env.TEST_ARTIFACT_VERSION }}-build' | ||
build: false | ||
publish: true | ||
|
||
snapshot: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
with: | ||
install: true | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/[email protected] | ||
with: | ||
images: | | ||
ghcr.io/arillso/action-ansible-collection-testartifact | ||
tags: | | ||
type=raw,value=SNAPSHOT-${{ github.sha }} | ||
- name: Build and Push | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
platforms: linux/amd64 | ||
file: ./Dockerfile | ||
push: false | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
env: | ||
IMAGE_NAME: arillso/action-ansible-collection | ||
|
||
name: Release | ||
jobs: | ||
release: | ||
name: Release GitHub Actions | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Semver release | ||
uses: technote-space/[email protected] | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CLEAN_TARGETS: '' | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- name: Get the version | ||
run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | ||
|
||
- name: Set up QEMU | ||
uses: docker/[email protected] | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
with: | ||
install: true | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/[email protected] | ||
with: | ||
images: | | ||
ghcr.io/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=raw,value=latest | ||
type=raw,value=${{ env.RELEASE_VERSION }} | ||
- name: Login to GitHub Container Registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and Push | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
platforms: linux/amd64, linux/arm64 | ||
file: ./Dockerfile | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
18 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
{ | ||
"printWidth": 80, | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"semi": false, | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"bracketSpacing": false, | ||
"arrowParens": "avoid", | ||
"parser": "typescript" | ||
"printWidth": 120, | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"semi": true, | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"bracketSpacing": true, | ||
"arrowParens": "avoid" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
FROM node:18-slim AS builder | ||
|
||
WORKDIR /app | ||
COPY package*.json ./ | ||
RUN npm install | ||
COPY . ./ | ||
RUN npm run build | ||
|
||
FROM node:18-slim AS runner | ||
|
||
# Required for python inside Docker containers | ||
ENV LC_ALL C.UTF-8 | ||
ENV LANG C.UTF-8 | ||
|
||
RUN apt-get update \ | ||
&& apt-get upgrade -y \ | ||
&& apt-get install -y --no-install-recommends python3 python3-pip python3-setuptools python3-wheel \ | ||
# Slim down layer size | ||
&& apt-get autoremove -y \ | ||
&& apt-get autoclean -y \ | ||
# Remove apt-get cache from the layer to reduce container size | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN npm install -g npm \ | ||
&& python3 -m pip install --no-cache-dir --upgrade pip | ||
|
||
WORKDIR /app | ||
|
||
COPY requirements.txt ./ | ||
RUN python3 -m pip install --no-cache-dir -r requirements.txt | ||
|
||
COPY --from=builder /app/dist ./dist | ||
COPY package*.json ./ | ||
RUN npm ci --production \ | ||
&& npm cache clean --force | ||
|
||
ENTRYPOINT ["node", "/app/dist/main.js"] |
This file contains 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
Oops, something went wrong.